mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-14 15:54:04 +02:00
Log all state change events
This commit is contained in:
parent
a570ac8bb8
commit
a4d0074710
1 changed files with 7 additions and 5 deletions
|
|
@ -998,17 +998,19 @@ class TurnOnOffListener:
|
|||
return
|
||||
|
||||
new_state = event.data.get("new_state")
|
||||
if (
|
||||
new_state is not None
|
||||
and new_state.state == STATE_ON
|
||||
and is_our_context(new_state.context)
|
||||
):
|
||||
if new_state is not None and new_state.state == STATE_ON:
|
||||
_LOGGER.debug(
|
||||
"Detected a '%s' 'state_changed' event: '%s' with context.id='%s'",
|
||||
entity_id,
|
||||
new_state.attributes,
|
||||
new_state.context.id,
|
||||
)
|
||||
|
||||
if (
|
||||
new_state is not None
|
||||
and new_state.state == STATE_ON
|
||||
and is_our_context(new_state.context)
|
||||
):
|
||||
# It is possible to have multiple state change events with the same context.
|
||||
# This can happen because a `turn_on.light(brightness_pct=100, transition=30)`
|
||||
# event leads to an instant state change of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue