mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 19:18:20 +00:00
Pass config entry to Snoo coordinator (#149947)
This commit is contained in:
parent
9edd242734
commit
9f867f268c
@ -46,7 +46,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: SnooConfigEntry) -> bool
|
||||
coordinators: dict[str, SnooCoordinator] = {}
|
||||
tasks = []
|
||||
for device in devices:
|
||||
coordinators[device.serialNumber] = SnooCoordinator(hass, device, snoo)
|
||||
coordinators[device.serialNumber] = SnooCoordinator(hass, entry, device, snoo)
|
||||
tasks.append(coordinators[device.serialNumber].setup())
|
||||
await asyncio.gather(*tasks)
|
||||
entry.runtime_data = coordinators
|
||||
|
@ -19,11 +19,18 @@ class SnooCoordinator(DataUpdateCoordinator[SnooData]):
|
||||
|
||||
config_entry: SnooConfigEntry
|
||||
|
||||
def __init__(self, hass: HomeAssistant, device: SnooDevice, snoo: Snoo) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
entry: SnooConfigEntry,
|
||||
device: SnooDevice,
|
||||
snoo: Snoo,
|
||||
) -> None:
|
||||
"""Set up Snoo Coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
name=device.name,
|
||||
config_entry=entry,
|
||||
logger=_LOGGER,
|
||||
)
|
||||
self.device_unique_id = device.serialNumber
|
||||
|
Loading…
x
Reference in New Issue
Block a user