mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 19:18:20 +00:00
Pass config entry to SMS coordinator (#149955)
This commit is contained in:
parent
93e11aa8bc
commit
9edd242734
@ -83,8 +83,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
if not gateway:
|
||||
raise ConfigEntryNotReady(f"Cannot find device {device}")
|
||||
|
||||
signal_coordinator = SignalCoordinator(hass, gateway)
|
||||
network_coordinator = NetworkCoordinator(hass, gateway)
|
||||
signal_coordinator = SignalCoordinator(hass, entry, gateway)
|
||||
network_coordinator = NetworkCoordinator(hass, entry, gateway)
|
||||
|
||||
# Fetch initial data so we have data when entities subscribe
|
||||
await signal_coordinator.async_config_entry_first_refresh()
|
||||
|
@ -16,13 +16,14 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class SignalCoordinator(DataUpdateCoordinator):
|
||||
"""Signal strength coordinator."""
|
||||
|
||||
def __init__(self, hass, gateway):
|
||||
def __init__(self, hass, entry, gateway):
|
||||
"""Initialize signal strength coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
name="Device signal state",
|
||||
update_interval=timedelta(seconds=DEFAULT_SCAN_INTERVAL),
|
||||
config_entry=entry,
|
||||
)
|
||||
self._gateway = gateway
|
||||
|
||||
@ -38,13 +39,14 @@ class SignalCoordinator(DataUpdateCoordinator):
|
||||
class NetworkCoordinator(DataUpdateCoordinator):
|
||||
"""Network info coordinator."""
|
||||
|
||||
def __init__(self, hass, gateway):
|
||||
def __init__(self, hass, entry, gateway):
|
||||
"""Initialize network info coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
name="Device network state",
|
||||
update_interval=timedelta(seconds=DEFAULT_SCAN_INTERVAL),
|
||||
config_entry=entry,
|
||||
)
|
||||
self._gateway = gateway
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user