mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
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:
@@ -27,7 +27,9 @@ async def test_config_entry(
|
||||
|
||||
diag = await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
||||
|
||||
assert diag == snapshot(exclude=props("last_updated", "last_changed"))
|
||||
assert diag == snapshot(
|
||||
exclude=props("last_changed", "last_reported", "last_updated")
|
||||
)
|
||||
|
||||
|
||||
async def test_device(
|
||||
@@ -45,4 +47,6 @@ async def test_device(
|
||||
|
||||
diag = await get_diagnostics_for_device(hass, hass_client, config_entry, device)
|
||||
|
||||
assert diag == snapshot(exclude=props("last_updated", "last_changed"))
|
||||
assert diag == snapshot(
|
||||
exclude=props("last_changed", "last_reported", "last_updated")
|
||||
)
|
||||
|
||||
@@ -265,6 +265,7 @@ async def test_snapshots(
|
||||
state_dict = dict(state.as_dict())
|
||||
state_dict.pop("context", None)
|
||||
state_dict.pop("last_changed", None)
|
||||
state_dict.pop("last_reported", None)
|
||||
state_dict.pop("last_updated", None)
|
||||
|
||||
state_dict["attributes"] = dict(state_dict["attributes"])
|
||||
|
||||
Reference in New Issue
Block a user