mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Explicitly pass in the config_entry in nuki coordinator (#138064)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
2bea300a7b
commit
9d6b031bf9
@ -222,7 +222,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _stop_nuki)
|
||||
)
|
||||
|
||||
coordinator = NukiCoordinator(hass, bridge, locks, openers)
|
||||
coordinator = NukiCoordinator(hass, entry, bridge, locks, openers)
|
||||
hass.data[DOMAIN][entry.entry_id] = NukiEntryData(
|
||||
coordinator=coordinator,
|
||||
bridge=bridge,
|
||||
|
@ -12,6 +12,7 @@ from pynuki.bridge import InvalidCredentialsException
|
||||
from pynuki.device import NukiDevice
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
@ -28,9 +29,12 @@ UPDATE_INTERVAL = timedelta(seconds=30)
|
||||
class NukiCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Data Update Coordinator for the Nuki integration."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
bridge: NukiBridge,
|
||||
locks: list[NukiLock],
|
||||
openers: list[NukiOpener],
|
||||
@ -39,9 +43,8 @@ class NukiCoordinator(DataUpdateCoordinator[None]):
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
# Name of the data. For logging purposes.
|
||||
config_entry=config_entry,
|
||||
name="nuki devices",
|
||||
# Polling interval. Will only be polled if there are subscribers.
|
||||
update_interval=UPDATE_INTERVAL,
|
||||
)
|
||||
self.bridge = bridge
|
||||
|
Loading…
x
Reference in New Issue
Block a user