mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Explicitly pass in the config_entry in kostal_plenticore coordinator (#138124)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
ca77b94565
commit
4705df9ec8
@ -16,6 +16,7 @@ from pykoplenti import (
|
||||
ExtendedApiClient,
|
||||
)
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
@ -162,9 +163,12 @@ class DataUpdateCoordinatorMixin:
|
||||
class PlenticoreUpdateCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
|
||||
"""Base implementation of DataUpdateCoordinator for Plenticore data."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
logger: logging.Logger,
|
||||
name: str,
|
||||
update_inverval: timedelta,
|
||||
@ -174,6 +178,7 @@ class PlenticoreUpdateCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
|
||||
super().__init__(
|
||||
hass=hass,
|
||||
logger=logger,
|
||||
config_entry=config_entry,
|
||||
name=name,
|
||||
update_interval=update_inverval,
|
||||
)
|
||||
@ -240,9 +245,12 @@ class SettingDataUpdateCoordinator(
|
||||
class PlenticoreSelectUpdateCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
|
||||
"""Base implementation of DataUpdateCoordinator for Plenticore data."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
logger: logging.Logger,
|
||||
name: str,
|
||||
update_inverval: timedelta,
|
||||
@ -252,6 +260,7 @@ class PlenticoreSelectUpdateCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
|
||||
super().__init__(
|
||||
hass=hass,
|
||||
logger=logger,
|
||||
config_entry=config_entry,
|
||||
name=name,
|
||||
update_interval=update_inverval,
|
||||
)
|
||||
|
@ -82,11 +82,7 @@ async def async_setup_entry(
|
||||
|
||||
available_settings_data = await plenticore.client.get_settings()
|
||||
settings_data_update_coordinator = SettingDataUpdateCoordinator(
|
||||
hass,
|
||||
_LOGGER,
|
||||
"Settings Data",
|
||||
timedelta(seconds=30),
|
||||
plenticore,
|
||||
hass, entry, _LOGGER, "Settings Data", timedelta(seconds=30), plenticore
|
||||
)
|
||||
|
||||
for description in NUMBER_SETTINGS_DATA:
|
||||
|
@ -49,11 +49,7 @@ async def async_setup_entry(
|
||||
|
||||
available_settings_data = await plenticore.client.get_settings()
|
||||
select_data_update_coordinator = SelectDataUpdateCoordinator(
|
||||
hass,
|
||||
_LOGGER,
|
||||
"Settings Data",
|
||||
timedelta(seconds=30),
|
||||
plenticore,
|
||||
hass, entry, _LOGGER, "Settings Data", timedelta(seconds=30), plenticore
|
||||
)
|
||||
|
||||
entities = []
|
||||
|
@ -816,11 +816,7 @@ async def async_setup_entry(
|
||||
|
||||
available_process_data = await plenticore.client.get_process_data()
|
||||
process_data_update_coordinator = ProcessDataUpdateCoordinator(
|
||||
hass,
|
||||
_LOGGER,
|
||||
"Process Data",
|
||||
timedelta(seconds=10),
|
||||
plenticore,
|
||||
hass, entry, _LOGGER, "Process Data", timedelta(seconds=10), plenticore
|
||||
)
|
||||
for description in SENSOR_PROCESS_DATA:
|
||||
module_id = description.module_id
|
||||
|
@ -57,11 +57,7 @@ async def async_setup_entry(
|
||||
|
||||
available_settings_data = await plenticore.client.get_settings()
|
||||
settings_data_update_coordinator = SettingDataUpdateCoordinator(
|
||||
hass,
|
||||
_LOGGER,
|
||||
"Settings Data",
|
||||
timedelta(seconds=30),
|
||||
plenticore,
|
||||
hass, entry, _LOGGER, "Settings Data", timedelta(seconds=30), plenticore
|
||||
)
|
||||
for description in SWITCH_SETTINGS_DATA:
|
||||
if (
|
||||
|
Loading…
x
Reference in New Issue
Block a user