Log all state change events

This commit is contained in:
Bas Nijholt 2020-10-09 09:43:37 +02:00
commit a4d0074710

View file

@ -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