mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 03:28:18 +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] = {}
|
coordinators: dict[str, SnooCoordinator] = {}
|
||||||
tasks = []
|
tasks = []
|
||||||
for device in devices:
|
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())
|
tasks.append(coordinators[device.serialNumber].setup())
|
||||||
await asyncio.gather(*tasks)
|
await asyncio.gather(*tasks)
|
||||||
entry.runtime_data = coordinators
|
entry.runtime_data = coordinators
|
||||||
|
@ -19,11 +19,18 @@ class SnooCoordinator(DataUpdateCoordinator[SnooData]):
|
|||||||
|
|
||||||
config_entry: SnooConfigEntry
|
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."""
|
"""Set up Snoo Coordinator."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
name=device.name,
|
name=device.name,
|
||||||
|
config_entry=entry,
|
||||||
logger=_LOGGER,
|
logger=_LOGGER,
|
||||||
)
|
)
|
||||||
self.device_unique_id = device.serialNumber
|
self.device_unique_id = device.serialNumber
|
||||||
|
Loading…
x
Reference in New Issue
Block a user