mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Fix case when from_state is None, closes #111
Made this commit on my phone and didn't test it yet.
This commit is contained in:
parent
d0e195f04b
commit
a464189ce0
1 changed files with 1 additions and 1 deletions
|
|
@ -382,7 +382,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity):
|
|||
await asyncio.wait(tasks)
|
||||
|
||||
async def _light_state_changed(self, entity_id, from_state, to_state):
|
||||
if to_state.state == "on" and from_state.state != "on":
|
||||
if to_state.state == "on" and (from_state is None or from_state.state != "on"):
|
||||
_LOGGER.debug(_difference_between_states(from_state, to_state))
|
||||
await self._force_update_switch(lights=[entity_id])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue