Explicitly pass in the config_entry in ws66i coordinator (#137865)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-08 16:45:57 +01:00 committed by GitHub
parent d07c2b8226
commit 5ade026b87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -78,6 +78,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Create the coordinator for the WS66i
coordinator: Ws66iDataUpdateCoordinator = Ws66iDataUpdateCoordinator(
hass,
entry,
ws66i,
zones,
)

View File

@ -6,6 +6,7 @@ import logging
from pyws66i import WS66i, ZoneStatus
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@ -17,9 +18,12 @@ _LOGGER = logging.getLogger(__name__)
class Ws66iDataUpdateCoordinator(DataUpdateCoordinator[list[ZoneStatus]]):
"""DataUpdateCoordinator to gather data for WS66i Zones."""
config_entry: ConfigEntry
def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
my_api: WS66i,
zones: list[int],
) -> None:
@ -27,6 +31,7 @@ class Ws66iDataUpdateCoordinator(DataUpdateCoordinator[list[ZoneStatus]]):
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name="WS66i",
update_interval=POLL_INTERVAL,
)