Fix tuya diagnostics mutating cached state objects (#65708)

pull/65713/head
Paulus Schoutsen 2022-02-04 11:11:21 -08:00
parent 5a44f8eadd
commit 56d1fc6dad
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ def _async_device_as_dict(hass: HomeAssistant, device: TuyaDevice) -> dict[str,
state = hass.states.get(entity_entry.entity_id)
state_dict = None
if state:
state_dict = state.as_dict()
state_dict = dict(state.as_dict())
# Redact the `entity_picture` attribute as it contains a token.
if "entity_picture" in state_dict["attributes"]: