Explicitly pass in the config_entry in lacrosse_view coordinator (#138122)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-09 20:51:15 +01:00 committed by GitHub
parent 4705df9ec8
commit 284a70932e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except LoginError as error: except LoginError as error:
raise ConfigEntryAuthFailed from error raise ConfigEntryAuthFailed from error
coordinator = LaCrosseUpdateCoordinator(hass, api, entry) coordinator = LaCrosseUpdateCoordinator(hass, entry, api)
_LOGGER.debug("First refresh") _LOGGER.debug("First refresh")
await coordinator.async_config_entry_first_refresh() await coordinator.async_config_entry_first_refresh()

View File

@ -27,12 +27,13 @@ class LaCrosseUpdateCoordinator(DataUpdateCoordinator[list[Sensor]]):
id: str id: str
hass: HomeAssistant hass: HomeAssistant
devices: list[Sensor] | None = None devices: list[Sensor] | None = None
config_entry: ConfigEntry
def __init__( def __init__(
self, self,
hass: HomeAssistant, hass: HomeAssistant,
api: LaCrosse,
entry: ConfigEntry, entry: ConfigEntry,
api: LaCrosse,
) -> None: ) -> None:
"""Initialize DataUpdateCoordinator for LaCrosse View.""" """Initialize DataUpdateCoordinator for LaCrosse View."""
self.api = api self.api = api
@ -45,6 +46,7 @@ class LaCrosseUpdateCoordinator(DataUpdateCoordinator[list[Sensor]]):
super().__init__( super().__init__(
hass, hass,
_LOGGER, _LOGGER,
config_entry=entry,
name="LaCrosse View", name="LaCrosse View",
update_interval=timedelta(seconds=SCAN_INTERVAL), update_interval=timedelta(seconds=SCAN_INTERVAL),
) )