Fix attribute access on None on startup in ESPHome (#56105)

This commit is contained in:
Oxan van Leeuwen
2021-09-11 20:53:29 +02:00
committed by GitHub
parent cb8c0cb123
commit 6e7ce89c64

View File

@@ -221,7 +221,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Only communicate changes to the state or attribute tracked # Only communicate changes to the state or attribute tracked
if ( if (
"old_state" in event.data event.data.get("old_state") is not None
and "new_state" in event.data and "new_state" in event.data
and ( and (
( (