From 61741f65017bcf2b9e8d8ae28db496b46cee9f74 Mon Sep 17 00:00:00 2001 From: Clayton Nummer Date: Fri, 21 Feb 2020 22:05:08 -0500 Subject: [PATCH] Fix getting initial transition from config --- custom_components/circadian_lighting/switch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 368b9d00..431f944e 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -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