Only validate entity id if it did not exist on state change (#41820)

This commit is contained in:
J. Nick Koston 2020-10-14 04:06:51 -05:00 committed by GitHub
parent 3cba25a892
commit afc602595b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1148,7 +1148,15 @@ class StateMachine:
if context is None:
context = Context()
state = State(entity_id, new_state, attributes, last_changed, None, context)
state = State(
entity_id,
new_state,
attributes,
last_changed,
None,
context,
old_state is None,
)
self._states[entity_id] = state
self._bus.async_fire(
EVENT_STATE_CHANGED,