Browse Source

Fix for grouped devices

master
Dirk Alders 1 year ago
parent
commit
5a94efbc8c
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      devices.py

+ 5
- 5
devices.py View File

61
                 self[topic] = this_device
61
                 self[topic] = this_device
62
         else:
62
         else:
63
             dg = []
63
             dg = []
64
-            for i in num:
64
+            for i in range(1, num + 1):
65
                 device_topic = topic + '_%d' % i
65
                 device_topic = topic + '_%d' % i
66
                 dg.append(get_device(dty, mqtt_client, device_topic))
66
                 dg.append(get_device(dty, mqtt_client, device_topic))
67
             self[topic] = devices.group(*dg)
67
             self[topic] = devices.group(*dg)
115
         roo = props.ROO_FLO
115
         roo = props.ROO_FLO
116
         #
116
         #
117
         self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1)            # Shelly Main Light
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
         # DIRK
120
         # DIRK
121
         roo = props.ROO_DIR
121
         roo = props.ROO_DIR
197
         #
197
         #
198
         self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1)            # Shelly Main Light
198
         self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1)            # Shelly Main Light
199
         self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT)            # Tradfri Main Light
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
         self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx)            # Brennenstuhl Heatingvalve
203
         self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx)            # Brennenstuhl Heatingvalve
204
 
204
 
205
     def __init_stw__(self, mqtt_client):
205
     def __init_stw__(self, mqtt_client):

Loading…
Cancel
Save