Fix incorrect handling of hass.data in WattTime setup (#56971)

This commit is contained in:
Aaron Bach 2021-10-02 18:58:10 -06:00 committed by GitHub
parent 6c2a18c3e5
commit 0e1630e46d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,8 @@ PLATFORMS: list[str] = ["sensor"]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up WattTime from a config entry."""
hass.data.setdefault(DOMAIN, {entry.entry_id: {DATA_COORDINATOR: {}}})
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = {}
session = aiohttp_client.async_get_clientsession(hass)