mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Explicitly pass in the config_entry in wemo coordinator (#137867)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
0ecff272f2
commit
f464aee33a
@ -88,13 +88,17 @@ class Options:
|
||||
class DeviceCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Home Assistant wrapper for a pyWeMo device."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
options: Options | None = None
|
||||
|
||||
def __init__(self, hass: HomeAssistant, wemo: WeMoDevice) -> None:
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, config_entry: ConfigEntry, wemo: WeMoDevice
|
||||
) -> None:
|
||||
"""Initialize DeviceCoordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=wemo.name,
|
||||
update_interval=timedelta(seconds=30),
|
||||
)
|
||||
@ -285,7 +289,7 @@ async def async_register_device(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry, wemo: WeMoDevice
|
||||
) -> DeviceCoordinator:
|
||||
"""Register a device with home assistant and enable pywemo event callbacks."""
|
||||
device = DeviceCoordinator(hass, wemo)
|
||||
device = DeviceCoordinator(hass, config_entry, wemo)
|
||||
await device.async_refresh()
|
||||
if not device.last_update_success and device.last_exception:
|
||||
raise device.last_exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user