Skip to content
Snippets Groups Projects
Unverified Commit 52363d53 authored by Michael's avatar Michael Committed by GitHub
Browse files

Explicitly pass in the config_entry in ialarm coordinator (#138147)

explicitly pass in the config_entry in coordinator
parent 284a7093
No related branches found
No related tags found
No related merge requests found
......@@ -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,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment