Air visual : robustness at startup when evaluate time interval (#59544)

This commit is contained in:
jugla
2021-11-13 16:44:18 +01:00
committed by Paulus Schoutsen
parent 4cae92a533
commit 89877a0685

View File

@@ -105,9 +105,10 @@ def async_get_cloud_coordinators_by_api_key(
) -> list[DataUpdateCoordinator]:
"""Get all DataUpdateCoordinator objects related to a particular API key."""
return [
attrs[DATA_COORDINATOR]
coordinator
for entry_id, attrs in hass.data[DOMAIN].items()
if (entry := hass.config_entries.async_get_entry(entry_id))
and (coordinator := attrs.get(DATA_COORDINATOR))
and entry.data.get(CONF_API_KEY) == api_key
]