mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Explicitly pass in the config_entry in aseko_pool_live coordinator init (#137711)
explicitly pass in the config_entry in aseko_pool_live coordinator init
This commit is contained in:
parent
c71116cc12
commit
92234f86e8
@ -26,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: AsekoConfigEntry) -> boo
|
|||||||
except AsekoNotLoggedIn as err:
|
except AsekoNotLoggedIn as err:
|
||||||
raise ConfigEntryAuthFailed from err
|
raise ConfigEntryAuthFailed from err
|
||||||
|
|
||||||
coordinator = AsekoDataUpdateCoordinator(hass, aseko)
|
coordinator = AsekoDataUpdateCoordinator(hass, entry, aseko)
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
entry.runtime_data = coordinator
|
entry.runtime_data = coordinator
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
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 AsekoDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Unit]]):
|
||||||
"""Class to manage fetching Aseko unit data from single endpoint."""
|
"""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."""
|
"""Initialize global Aseko unit data updater."""
|
||||||
self._aseko = aseko
|
self._aseko = aseko
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_interval=timedelta(minutes=2),
|
update_interval=timedelta(minutes=2),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user