Explicitly pass in the config_entry in stookwijzer coordinator (#137928)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-08 21:36:59 +01:00 committed by GitHub
parent 071b46055b
commit 13dbeed5c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,18 +20,23 @@ type StookwijzerConfigEntry = ConfigEntry[StookwijzerCoordinator]
class StookwijzerCoordinator(DataUpdateCoordinator[None]): class StookwijzerCoordinator(DataUpdateCoordinator[None]):
"""Stookwijzer update coordinator.""" """Stookwijzer update coordinator."""
def __init__(self, hass: HomeAssistant, entry: StookwijzerConfigEntry) -> None: config_entry: StookwijzerConfigEntry
def __init__(
self, hass: HomeAssistant, config_entry: StookwijzerConfigEntry
) -> None:
"""Initialize the coordinator.""" """Initialize the coordinator."""
super().__init__( super().__init__(
hass, hass,
LOGGER, LOGGER,
config_entry=config_entry,
name=DOMAIN, name=DOMAIN,
update_interval=SCAN_INTERVAL, update_interval=SCAN_INTERVAL,
) )
self.client = Stookwijzer( self.client = Stookwijzer(
async_get_clientsession(hass), async_get_clientsession(hass),
entry.data[CONF_LATITUDE], config_entry.data[CONF_LATITUDE],
entry.data[CONF_LONGITUDE], config_entry.data[CONF_LONGITUDE],
) )
async def _async_update_data(self) -> None: async def _async_update_data(self) -> None: