Convert States to dicts via as_dict only once (#41208)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
2f54bf29ba
commit
4798f37c6e
4 changed files with 63 additions and 20 deletions
|
@ -201,10 +201,7 @@ async def test_get_states(hass, websocket_client):
|
|||
|
||||
states = []
|
||||
for state in hass.states.async_all():
|
||||
state = state.as_dict()
|
||||
state["last_changed"] = state["last_changed"].isoformat()
|
||||
state["last_updated"] = state["last_updated"].isoformat()
|
||||
states.append(state)
|
||||
states.append(state.as_dict())
|
||||
|
||||
assert msg["result"] == states
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue