Explicitly pass in the config_entry in aseko_pool_live coordinator init (#137711)
explicitly pass in the config_entry in aseko_pool_live coordinator initpull/137714/merge
parent
c71116cc12
commit
92234f86e8
|
@ -26,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: AsekoConfigEntry) -> boo
|
|||
except AsekoNotLoggedIn as err:
|
||||
raise ConfigEntryAuthFailed from err
|
||||
|
||||
coordinator = AsekoDataUpdateCoordinator(hass, aseko)
|
||||
coordinator = AsekoDataUpdateCoordinator(hass, entry, aseko)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
entry.runtime_data = coordinator
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
|
|
|
@ -21,13 +21,18 @@ type AsekoConfigEntry = ConfigEntry[AsekoDataUpdateCoordinator]
|
|||
class AsekoDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Unit]]):
|
||||
"""Class to manage fetching Aseko unit data from single endpoint."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, aseko: Aseko) -> None:
|
||||
config_entry: AsekoConfigEntry
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, config_entry: AsekoConfigEntry, aseko: Aseko
|
||||
) -> None:
|
||||
"""Initialize global Aseko unit data updater."""
|
||||
self._aseko = aseko
|
||||
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=timedelta(minutes=2),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue