Fix Airly if more than one config entry (#28498)

This commit is contained in:
Maciej Bieniek 2019-11-04 00:58:35 +01:00 committed by Paulus Schoutsen
parent 1618c5c040
commit f5306f769c

View File

@ -31,6 +31,8 @@ DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Airly."""
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
return True
@ -49,8 +51,6 @@ async def async_setup_entry(hass, config_entry):
if not airly.data:
raise ConfigEntryNotReady()
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = airly
hass.async_create_task(