bug-fix: device status led in gfw_dirk
This commit is contained in:
parent
2864660082
commit
0dda549124
@ -243,8 +243,6 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
|
|||||||
self.active_device_state = self.STATE_ACTIVE_DEVICE_AMPLIFIER
|
self.active_device_state = self.STATE_ACTIVE_DEVICE_AMPLIFIER
|
||||||
else:
|
else:
|
||||||
self.choose_next_device()
|
self.choose_next_device()
|
||||||
for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
|
|
||||||
self.active_device_state_led.set_state(num, self.active_device_state == num)
|
|
||||||
|
|
||||||
def get_activity_state(self, state):
|
def get_activity_state(self, state):
|
||||||
if state == self.STATE_ACTIVE_DEVICE_MAIN_LIGHT:
|
if state == self.STATE_ACTIVE_DEVICE_MAIN_LIGHT:
|
||||||
@ -261,6 +259,8 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
|
|||||||
target_state = (start_value + i + 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
|
target_state = (start_value + i + 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
|
||||||
if self.get_activity_state(target_state):
|
if self.get_activity_state(target_state):
|
||||||
self.active_device_state = target_state
|
self.active_device_state = target_state
|
||||||
|
for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
|
||||||
|
self.active_device_state_led.set_state(num, self.active_device_state == num)
|
||||||
return
|
return
|
||||||
self.active_device_state = None
|
self.active_device_state = None
|
||||||
|
|
||||||
@ -271,6 +271,8 @@ class ground_floor_west_dirk(room_shelly_tradfri_light):
|
|||||||
target_state = (start_value - i - 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
|
target_state = (start_value - i - 1) % (self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1)
|
||||||
if self.get_activity_state(target_state):
|
if self.get_activity_state(target_state):
|
||||||
self.active_device_state = target_state
|
self.active_device_state = target_state
|
||||||
|
for num in range(0, self.STATE_ACTIVE_DEVICE_MAX_VALUE + 1):
|
||||||
|
self.active_device_state_led.set_state(num, self.active_device_state == num)
|
||||||
return
|
return
|
||||||
self.active_device_state = None
|
self.active_device_state = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user