diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 6fdccf9..977bfc2 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -243,8 +243,6 @@ class ground_floor_west_dirk(room_shelly_tradfri_light): self.active_device_state = self.STATE_ACTIVE_DEVICE_AMPLIFIER else: 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): 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) if self.get_activity_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 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) if self.get_activity_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 self.active_device_state = None