Add State.last_reported (#113511)
* Add State.last_reported * Update tests * Update test snapshots * Call state_reported listeners when firing state_changed event * Add tests
This commit is contained in:
parent
e74791083e
commit
426f73b1f4
174 changed files with 1645 additions and 35 deletions
|
@ -294,14 +294,25 @@ def create_state_changed_event(
|
|||
state,
|
||||
attributes=None,
|
||||
last_changed=None,
|
||||
last_reported=None,
|
||||
last_updated=None,
|
||||
):
|
||||
"""Create state changed event."""
|
||||
old_state = ha.State(
|
||||
entity_id, "old", attributes, last_changed, last_updated
|
||||
entity_id,
|
||||
"old",
|
||||
attributes,
|
||||
last_changed=last_changed,
|
||||
last_reported=last_reported,
|
||||
last_updated=last_updated,
|
||||
).as_dict()
|
||||
new_state = ha.State(
|
||||
entity_id, state, attributes, last_changed, last_updated
|
||||
entity_id,
|
||||
state,
|
||||
attributes,
|
||||
last_changed=last_changed,
|
||||
last_reported=last_reported,
|
||||
last_updated=last_updated,
|
||||
).as_dict()
|
||||
|
||||
return create_state_changed_event_from_old_new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue