Convert States to dicts via as_dict only once (#41208)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston
2020-10-05 09:18:57 -05:00
committed by GitHub
parent 2f54bf29ba
commit 4798f37c6e
4 changed files with 63 additions and 20 deletions

View File

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