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