mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Explicitly pass in the config_entry in ialarm coordinator (#138147)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
284a70932e
commit
52363d5369
@ -29,7 +29,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
except (TimeoutError, ConnectionError) as ex:
|
||||
raise ConfigEntryNotReady from ex
|
||||
|
||||
coordinator = IAlarmDataUpdateCoordinator(hass, ialarm, mac)
|
||||
coordinator = IAlarmDataUpdateCoordinator(hass, entry, ialarm, mac)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
|
@ -11,6 +11,7 @@ from homeassistant.components.alarm_control_panel import (
|
||||
SCAN_INTERVAL,
|
||||
AlarmControlPanelState,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
||||
@ -22,7 +23,11 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class IAlarmDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Class to manage fetching iAlarm data."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, ialarm: IAlarm, mac: str) -> None:
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, config_entry: ConfigEntry, ialarm: IAlarm, mac: str
|
||||
) -> None:
|
||||
"""Initialize global iAlarm data updater."""
|
||||
self.ialarm = ialarm
|
||||
self.state: AlarmControlPanelState | None = None
|
||||
@ -32,6 +37,7 @@ class IAlarmDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=SCAN_INTERVAL,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user