Sfoglia il codice sorgente

Fix for grouped devices

master
Dirk Alders 1 anno fa
parent
commit
5a94efbc8c
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5
    5
      devices.py

+ 5
- 5
devices.py Vedi File

@@ -61,7 +61,7 @@ class base(dict):
61 61
                 self[topic] = this_device
62 62
         else:
63 63
             dg = []
64
-            for i in num:
64
+            for i in range(1, num + 1):
65 65
                 device_topic = topic + '_%d' % i
66 66
                 dg.append(get_device(dty, mqtt_client, device_topic))
67 67
             self[topic] = devices.group(*dg)
@@ -115,7 +115,7 @@ class physical_devices(base):
115 115
         roo = props.ROO_FLO
116 116
         #
117 117
         self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1)            # Shelly Main Light
118
-        self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, props.DTY_LLI_SBT)            # Tradfri Main Light
118
+        self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, props.DTY_LLI_SBT, 2)         # Tradfri Main Light
119 119
 
120 120
         # DIRK
121 121
         roo = props.ROO_DIR
@@ -197,9 +197,9 @@ class physical_devices(base):
197 197
         #
198 198
         self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1)            # Shelly Main Light
199 199
         self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT)            # Tradfri Main Light
200
-        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, props.DTY_TLI_SBT)            # Tradfri Main Light
201
-        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XTR, props.DTY_SPP_SW1)            # Tradfri Main Light
202
-        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XST, props.DTY_SPP_SW1)            # Tradfri Main Light
200
+        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, props.DTY_TLI_SBT, 6)         # Tradfri Floorlamp
201
+        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XTR, props.DTY_SPP_SW1)            # X-Mas Tree
202
+        self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XST, props.DTY_SPP_SW1)            # X-Mas Star
203 203
         self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx)            # Brennenstuhl Heatingvalve
204 204
 
205 205
     def __init_stw__(self, mqtt_client):

Loading…
Annulla
Salva