Moved homebridge config to host-specific.
authorLuke Hoersten <luke@hoersten.org>
Sun, 24 May 2020 20:34:57 -0500
changeset 31 c51c4eaea2a7
parent 30 bf16f2477a11
child 32 78242f9f4010
Moved homebridge config to host-specific.
homebridge/defaults/main.yaml
homebridge/tasks/main.yaml
homebridge/templates/config.json.j2
--- a/homebridge/defaults/main.yaml	Sun May 24 20:04:59 2020 -0500
+++ b/homebridge/defaults/main.yaml	Sun May 24 20:34:57 2020 -0500
@@ -6,19 +6,3 @@
 
 homebridge_pin: "031-45-154"
 homebridge_port: "51900"
-
-homebridge_apt_packages:
-  - "libavahi-compat-libdnssd-dev"
-  - "ffmpeg"
-
-homebridge_npm_packages:
-  - "homebridge-camera-ffmpeg"
-  - "homebridge-roomba-stv"
-
-homebridge_rtsp_vcodec: "copy"
-homebridge_rtsp_debug: "false"
-homebridge_rtsp_max_streams: 5
-
-homebridge_roomba_auto_refresh: "true"
-homebridge_roomba_keep_alive: "true"
-homebridge_roomba_cache_TTL: "30"
--- a/homebridge/tasks/main.yaml	Sun May 24 20:04:59 2020 -0500
+++ b/homebridge/tasks/main.yaml	Sun May 24 20:34:57 2020 -0500
@@ -32,13 +32,13 @@
 - name: install platform accessories
   become: yes
   npm: name="{{item}}" global="yes"
+  with_items: "{{homebridge_npm_packages}}"
   notify: restart homebridge service
-  with_items: "{{homebridge_npm_packages}}"
 
 - name: configure homebridge
   become: yes
   template:
-    src: "config.json.j2"
+    src: "{{homebridge_config_template}}"
     dest: "{{homebridge_dir}}/config.json"
   notify: restart homebridge service
 
--- a/homebridge/templates/config.json.j2	Sun May 24 20:04:59 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-{
-    "bridge": {
-        "name": "Homebridge",
-        "username": "{{ansible_default_ipv4.macaddress | upper}}",
-        "port": {{homebridge_port}},
-        "pin": "{{homebridge_pin}}"
-    },
-
-    "description": "Homebridge",
-
-    "platforms": [
-
-        {"platform": "Camera-ffmpeg",
-         "cameras": [
-
-        {% for cam in homebridge_rtsp_cams %}
-            {"name": "{{cam.name}}", "videoConfig": {
-                "source": "-i {{cam.rtsp_url}}",
-                "stillImageSource": "-i {{cam.rtsp_url}} -vframes 1 -r 1",
-                "vcodec": "{{homebridge_rtsp_vcodec}}",
-                "maxStreams": {{homebridge_rtsp_max_streams}},
-                "debug": {{homebridge_rtsp_debug}}
-            }
-        {% if not loop.last %}
-        },
-        {% else %}
-        }
-        {% endif %}
-        {% endfor %}
-        ]}
-
-    ],
-
-    "accessories": [
-        {
-          "accessory": "Roomba",
-          "name": "Roomba",
-          "model": "{{homebridge_roomba_model}}",
-          "blid": "{{homebridge_roomba_blid}}",
-          "robotpwd": "{{homebridge_roomba_passwd}}",
-          "ipaddress": "{{homebridge_roomba_ip}}",
-          "autoRefreshEnabled": {{homebridge_roomba_auto_refresh}},
-          "keepAliveEnabled": {{homebridge_roomba_keep_alive}},
-          "cacheTTL": {{homebridge_roomba_cache_TTL}}
-        }
-    ]
-
-}