From 8cd6a255cd575a058fb65d1c2772bbfaa73525f5 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 11 Sep 2020 21:02:32 +0200 Subject: [PATCH] add transition=self._initial_transition --- custom_components/circadian_lighting/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 662c52d7..b86a0bf4 100755 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -346,7 +346,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): async def async_turn_on(self, **kwargs): """Turn on circadian lighting.""" self._state = True - await self._update_lights() + await self._update_lights(transition=self._initial_transition) async def async_turn_off(self, **kwargs): """Turn off circadian lighting.""" @@ -555,8 +555,8 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): assert to_state.state == "on" if from_state is None or from_state.state != "on": _LOGGER.debug(_difference_between_states(from_state, to_state)) - await self._update_lights(lights=[entity_id]) + await self._update_lights(lights=[entity_id], transition=self._initial_transition) async def _state_changed(self, entity_id, from_state, to_state): _LOGGER.debug(_difference_between_states(from_state, to_state)) - await self._update_lights() + await self._update_lights(transition=self._initial_transition)