mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Migrate to runtime data in Overkiz (#133760)
* Migrate to runtime data * Revert * Improve typing
This commit is contained in:
parent
cd6da9d9e8
commit
c3d0a01776
@ -47,14 +47,17 @@ from .coordinator import OverkizDataUpdateCoordinator
|
||||
|
||||
@dataclass
|
||||
class HomeAssistantOverkizData:
|
||||
"""Overkiz data stored in the Home Assistant data object."""
|
||||
"""Overkiz data stored in the runtime data object."""
|
||||
|
||||
coordinator: OverkizDataUpdateCoordinator
|
||||
platforms: defaultdict[Platform, list[Device]]
|
||||
scenarios: list[Scenario]
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
type OverkizDataConfigEntry = ConfigEntry[HomeAssistantOverkizData]
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: OverkizDataConfigEntry) -> bool:
|
||||
"""Set up Overkiz from a config entry."""
|
||||
client: OverkizClient | None = None
|
||||
api_type = entry.data.get(CONF_API_TYPE, APIType.CLOUD)
|
||||
@ -123,7 +126,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
|
||||
platforms: defaultdict[Platform, list[Device]] = defaultdict(list)
|
||||
|
||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = HomeAssistantOverkizData(
|
||||
entry.runtime_data = HomeAssistantOverkizData(
|
||||
coordinator=coordinator, platforms=platforms, scenarios=scenarios
|
||||
)
|
||||
|
||||
@ -162,17 +165,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
async def async_unload_entry(
|
||||
hass: HomeAssistant, entry: OverkizDataConfigEntry
|
||||
) -> bool:
|
||||
"""Unload a config entry."""
|
||||
|
||||
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
||||
hass.data[DOMAIN].pop(entry.entry_id)
|
||||
|
||||
return unload_ok
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
|
||||
|
||||
async def _async_migrate_entries(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry
|
||||
hass: HomeAssistant, config_entry: OverkizDataConfigEntry
|
||||
) -> bool:
|
||||
"""Migrate old entries to new unique IDs."""
|
||||
entity_registry = er.async_get(hass)
|
||||
|
@ -16,14 +16,12 @@ from homeassistant.components.alarm_control_panel import (
|
||||
AlarmControlPanelEntityFeature,
|
||||
AlarmControlPanelState,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityDescription
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .coordinator import OverkizDataUpdateCoordinator
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
@ -210,11 +208,11 @@ SUPPORTED_DEVICES = {description.key: description for description in ALARM_DESCR
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz alarm control panel from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizAlarmControlPanel(
|
||||
|
@ -18,8 +18,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
||||
from .const import IGNORED_OVERKIZ_DEVICES
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@ -147,7 +146,7 @@ async def async_setup_entry(
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz binary sensors from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[OverkizBinarySensor] = []
|
||||
|
||||
for device in data.coordinator.data.values():
|
||||
|
@ -12,13 +12,12 @@ from homeassistant.components.button import (
|
||||
ButtonEntity,
|
||||
ButtonEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
||||
from . import OverkizDataConfigEntry
|
||||
from .const import IGNORED_OVERKIZ_DEVICES
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@ -100,11 +99,11 @@ SUPPORTED_COMMANDS = {
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz button from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[ButtonEntity] = []
|
||||
|
||||
for device in data.coordinator.data.values():
|
||||
|
@ -7,14 +7,12 @@ from enum import StrEnum, unique
|
||||
from pyoverkiz.enums import Protocol
|
||||
from pyoverkiz.enums.ui import UIWidget
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .. import HomeAssistantOverkizData
|
||||
from ..const import DOMAIN
|
||||
from .. import OverkizDataConfigEntry
|
||||
from .atlantic_electrical_heater import AtlanticElectricalHeater
|
||||
from .atlantic_electrical_heater_with_adjustable_temperature_setpoint import (
|
||||
AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint,
|
||||
@ -79,11 +77,11 @@ WIDGET_AND_PROTOCOL_TO_CLIMATE_ENTITY = {
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz climate from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
# Match devices based on the widget.
|
||||
entities_based_on_widget: list[Entity] = [
|
||||
|
@ -2,23 +2,23 @@
|
||||
|
||||
from pyoverkiz.enums import OverkizCommand, UIClass
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .. import HomeAssistantOverkizData
|
||||
from ..const import DOMAIN
|
||||
from .. import OverkizDataConfigEntry
|
||||
from .awning import Awning
|
||||
from .generic_cover import OverkizGenericCover
|
||||
from .vertical_cover import LowSpeedCover, VerticalCover
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz covers from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
entities: list[OverkizGenericCover] = [
|
||||
Awning(device.device_url, data.coordinator)
|
||||
|
@ -7,20 +7,18 @@ from typing import Any
|
||||
from pyoverkiz.enums import APIType
|
||||
from pyoverkiz.obfuscate import obfuscate_id
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.device_registry import DeviceEntry
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import CONF_API_TYPE, CONF_HUB, DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .const import CONF_API_TYPE, CONF_HUB
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, entry: ConfigEntry
|
||||
hass: HomeAssistant, entry: OverkizDataConfigEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
entry_data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
client = entry_data.coordinator.client
|
||||
client = entry.runtime_data.coordinator.client
|
||||
|
||||
data = {
|
||||
"setup": await client.get_diagnostic_data(),
|
||||
@ -39,11 +37,10 @@ async def async_get_config_entry_diagnostics(
|
||||
|
||||
|
||||
async def async_get_device_diagnostics(
|
||||
hass: HomeAssistant, entry: ConfigEntry, device: DeviceEntry
|
||||
hass: HomeAssistant, entry: OverkizDataConfigEntry, device: DeviceEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a device entry."""
|
||||
entry_data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
client = entry_data.coordinator.client
|
||||
client = entry.runtime_data.coordinator.client
|
||||
|
||||
device_url = min(device.identifiers)[1]
|
||||
|
||||
|
@ -12,24 +12,22 @@ from homeassistant.components.light import (
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .coordinator import OverkizDataUpdateCoordinator
|
||||
from .entity import OverkizEntity
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz lights from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizLight(device.device_url, data.coordinator)
|
||||
|
@ -7,23 +7,21 @@ from typing import Any
|
||||
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
|
||||
|
||||
from homeassistant.components.lock import LockEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .entity import OverkizEntity
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz locks from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizLock(device.device_url, data.coordinator)
|
||||
|
@ -14,13 +14,12 @@ from homeassistant.components.number import (
|
||||
NumberEntity,
|
||||
NumberEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory, UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
||||
from . import OverkizDataConfigEntry
|
||||
from .const import IGNORED_OVERKIZ_DEVICES
|
||||
from .coordinator import OverkizDataUpdateCoordinator
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
@ -191,11 +190,11 @@ SUPPORTED_STATES = {description.key: description for description in NUMBER_DESCR
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz number from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[OverkizNumber] = []
|
||||
|
||||
for device in data.coordinator.data.values():
|
||||
|
@ -8,21 +8,19 @@ from pyoverkiz.client import OverkizClient
|
||||
from pyoverkiz.models import Scenario
|
||||
|
||||
from homeassistant.components.scene import Scene
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz scenes from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizScene(scene, data.coordinator.client) for scene in data.scenarios
|
||||
|
@ -8,13 +8,12 @@ from dataclasses import dataclass
|
||||
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
|
||||
|
||||
from homeassistant.components.select import SelectEntity, SelectEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
||||
from . import OverkizDataConfigEntry
|
||||
from .const import IGNORED_OVERKIZ_DEVICES
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@ -129,11 +128,11 @@ SUPPORTED_STATES = {description.key: description for description in SELECT_DESCR
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz select from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[OverkizSelect] = []
|
||||
|
||||
for device in data.coordinator.data.values():
|
||||
|
@ -15,7 +15,6 @@ from homeassistant.components.sensor import (
|
||||
SensorEntityDescription,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
LIGHT_LUX,
|
||||
@ -34,7 +33,7 @@ from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import StateType
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from . import OverkizDataConfigEntry
|
||||
from .const import (
|
||||
DOMAIN,
|
||||
IGNORED_OVERKIZ_DEVICES,
|
||||
@ -483,11 +482,11 @@ SUPPORTED_STATES = {description.key: description for description in SENSOR_DESCR
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz sensors from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[SensorEntity] = []
|
||||
|
||||
for device in data.coordinator.data.values():
|
||||
|
@ -10,23 +10,21 @@ from homeassistant.components.siren import (
|
||||
SirenEntity,
|
||||
SirenEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .entity import OverkizEntity
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz sirens from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizSiren(device.device_url, data.coordinator)
|
||||
|
@ -15,13 +15,11 @@ from homeassistant.components.switch import (
|
||||
SwitchEntity,
|
||||
SwitchEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from . import OverkizDataConfigEntry
|
||||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@ -111,11 +109,11 @@ SUPPORTED_DEVICES = {
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz switch from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
|
||||
async_add_entities(
|
||||
OverkizSwitch(
|
||||
|
@ -1,42 +0,0 @@
|
||||
"""Support for Overkiz water heater devices."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import HomeAssistantOverkizData
|
||||
from .const import DOMAIN
|
||||
from .entity import OverkizEntity
|
||||
from .water_heater_entities import (
|
||||
CONTROLLABLE_NAME_TO_WATER_HEATER_ENTITY,
|
||||
WIDGET_TO_WATER_HEATER_ENTITY,
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz DHW from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
entities: list[OverkizEntity] = []
|
||||
|
||||
for device in data.platforms[Platform.WATER_HEATER]:
|
||||
if device.controllable_name in CONTROLLABLE_NAME_TO_WATER_HEATER_ENTITY:
|
||||
entities.append(
|
||||
CONTROLLABLE_NAME_TO_WATER_HEATER_ENTITY[device.controllable_name](
|
||||
device.device_url, data.coordinator
|
||||
)
|
||||
)
|
||||
elif device.widget in WIDGET_TO_WATER_HEATER_ENTITY:
|
||||
entities.append(
|
||||
WIDGET_TO_WATER_HEATER_ENTITY[device.widget](
|
||||
device.device_url, data.coordinator
|
||||
)
|
||||
)
|
||||
|
||||
async_add_entities(entities)
|
@ -4,13 +4,11 @@ from __future__ import annotations
|
||||
|
||||
from pyoverkiz.enums.ui import UIWidget
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .. import HomeAssistantOverkizData
|
||||
from ..const import DOMAIN
|
||||
from .. import OverkizDataConfigEntry
|
||||
from ..entity import OverkizEntity
|
||||
from .atlantic_domestic_hot_water_production_mlb_component import (
|
||||
AtlanticDomesticHotWaterProductionMBLComponent,
|
||||
@ -22,11 +20,11 @@ from .hitachi_dhw import HitachiDHW
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
entry: OverkizDataConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the Overkiz DHW from a config entry."""
|
||||
data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
|
||||
data = entry.runtime_data
|
||||
entities: list[OverkizEntity] = []
|
||||
|
||||
for device in data.platforms[Platform.WATER_HEATER]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user