瀏覽代碼

bug-fix: device status led in gfw_dirk

tags/v1.0.0
Dirk Alders 2 年之前
父節點
當前提交
0dda549124
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. 4
    2
      function/ground_floor_west.py

+ 4
- 2
function/ground_floor_west.py 查看文件

@@ -243,8 +243,6 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
243 243
                     self.active_device_state = self.STATE_ACTIVE_DEVICE_AMPLIFIER
244 244
                 else:
245 245
                     self.choose_next_device()
246
-        for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
247
-            self.active_device_state_led.set_state(num, self.active_device_state == num)
248 246
 
249 247
     def get_activity_state(self, state):
250 248
         if state == self.STATE_ACTIVE_DEVICE_MAIN_LIGHT:
@@ -261,6 +259,8 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
261 259
                 target_state = (start_value + i + 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
262 260
                 if self.get_activity_state(target_state):
263 261
                     self.active_device_state = target_state
262
+                    for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
263
+                        self.active_device_state_led.set_state(num, self.active_device_state == num)
264 264
                     return
265 265
         self.active_device_state = None
266 266
 
@@ -271,6 +271,8 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
271 271
                 target_state = (start_value - i - 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
272 272
                 if self.get_activity_state(target_state):
273 273
                     self.active_device_state = target_state
274
+                    for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
275
+                        self.active_device_state_led.set_state(num, self.active_device_state == num)
274 276
                     return
275 277
         self.active_device_state = None
276 278
 

Loading…
取消
儲存