mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Explicitly pass in the config_entry in waqi coordinator (#137873)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
5ade026b87
commit
3cce2d679c
@ -21,7 +21,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
client = WAQIClient(session=async_get_clientsession(hass))
|
||||
client.authenticate(entry.data[CONF_API_KEY])
|
||||
|
||||
waqi_coordinator = WAQIDataUpdateCoordinator(hass, client)
|
||||
waqi_coordinator = WAQIDataUpdateCoordinator(hass, entry, client)
|
||||
await waqi_coordinator.async_config_entry_first_refresh()
|
||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = waqi_coordinator
|
||||
|
||||
|
@ -18,11 +18,14 @@ class WAQIDataUpdateCoordinator(DataUpdateCoordinator[WAQIAirQuality]):
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(self, hass: HomeAssistant, client: WAQIClient) -> None:
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, config_entry: ConfigEntry, client: WAQIClient
|
||||
) -> None:
|
||||
"""Initialize the WAQI data coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=timedelta(minutes=5),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user