Explicitly pass in the config_entry in intellifire coordinator (#138143)
explicitly pass in the config_entry in coordinatorpull/138157/head
parent
15af006fbe
commit
7c9d30eb06
|
@ -128,9 +128,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
) from err
|
) from err
|
||||||
|
|
||||||
# Construct coordinator
|
# Construct coordinator
|
||||||
data_update_coordinator = IntellifireDataUpdateCoordinator(
|
data_update_coordinator = IntellifireDataUpdateCoordinator(hass, entry, fireplace)
|
||||||
hass=hass, fireplace=fireplace
|
|
||||||
)
|
|
||||||
|
|
||||||
LOGGER.debug("Fireplace to Initialized - Awaiting first refresh")
|
LOGGER.debug("Fireplace to Initialized - Awaiting first refresh")
|
||||||
await data_update_coordinator.async_config_entry_first_refresh()
|
await data_update_coordinator.async_config_entry_first_refresh()
|
||||||
|
|
|
@ -9,6 +9,7 @@ from intellifire4py.control import IntelliFireController
|
||||||
from intellifire4py.model import IntelliFirePollData
|
from intellifire4py.model import IntelliFirePollData
|
||||||
from intellifire4py.read import IntelliFireDataProvider
|
from intellifire4py.read import IntelliFireDataProvider
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
@ -19,15 +20,19 @@ from .const import DOMAIN, LOGGER
|
||||||
class IntellifireDataUpdateCoordinator(DataUpdateCoordinator[IntelliFirePollData]):
|
class IntellifireDataUpdateCoordinator(DataUpdateCoordinator[IntelliFirePollData]):
|
||||||
"""Class to manage the polling of the fireplace API."""
|
"""Class to manage the polling of the fireplace API."""
|
||||||
|
|
||||||
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
fireplace: UnifiedFireplace,
|
fireplace: UnifiedFireplace,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the Coordinator."""
|
"""Initialize the Coordinator."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
LOGGER,
|
LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_interval=timedelta(seconds=15),
|
update_interval=timedelta(seconds=15),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue