mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Fix getting initial transition from config
This commit is contained in:
parent
05f98fa673
commit
61741f6501
1 changed files with 4 additions and 4 deletions
|
|
@ -200,7 +200,7 @@ class CircadianSwitch(SwitchDevice, RestoreEntity):
|
|||
self._state = True
|
||||
|
||||
# Make initial update
|
||||
self.update_switch(CONF_INITIAL_TRANSITION)
|
||||
self.update_switch(self._initial_transition)
|
||||
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ class CircadianSwitch(SwitchDevice, RestoreEntity):
|
|||
try:
|
||||
_LOGGER.debug(entity_id + " change from " + str(from_state) + " to " + str(to_state))
|
||||
if to_state.state == 'on' and from_state.state != 'on':
|
||||
self.adjust_lights([entity_id], CONF_INITIAL_TRANSITION)
|
||||
self.adjust_lights([entity_id], self._initial_transition)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ class CircadianSwitch(SwitchDevice, RestoreEntity):
|
|||
try:
|
||||
_LOGGER.debug(entity_id + " change from " + str(from_state) + " to " + str(to_state))
|
||||
if to_state.state == self._sleep_state or from_state.state == self._sleep_state:
|
||||
self.update_switch(CONF_INITIAL_TRANSITION)
|
||||
self.update_switch(self._initial_transition)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
@ -352,6 +352,6 @@ class CircadianSwitch(SwitchDevice, RestoreEntity):
|
|||
try:
|
||||
_LOGGER.debug(entity_id + " change from " + str(from_state) + " to " + str(to_state))
|
||||
if from_state.state == self._disable_state:
|
||||
self.update_switch(CONF_INITIAL_TRANSITION)
|
||||
self.update_switch(self._initial_transition)
|
||||
except:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue