-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move overkiz water heater definitions (#125756)
- Loading branch information
Showing
6 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""Support for Overkiz water heater devices.""" | ||
|
||
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 ..entity import OverkizEntity | ||
from .atlantic_domestic_hot_water_production_mlb_component import ( | ||
AtlanticDomesticHotWaterProductionMBLComponent, | ||
) | ||
from .atlantic_pass_apc_dhw import AtlanticPassAPCDHW | ||
from .domestic_hot_water_production import DomesticHotWaterProduction | ||
from .hitachi_dhw import HitachiDHW | ||
|
||
|
||
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) | ||
|
||
|
||
WIDGET_TO_WATER_HEATER_ENTITY = { | ||
UIWidget.ATLANTIC_PASS_APC_DHW: AtlanticPassAPCDHW, | ||
UIWidget.DOMESTIC_HOT_WATER_PRODUCTION: DomesticHotWaterProduction, | ||
UIWidget.HITACHI_DHW: HitachiDHW, | ||
} | ||
|
||
CONTROLLABLE_NAME_TO_WATER_HEATER_ENTITY = { | ||
"modbuslink:AtlanticDomesticHotWaterProductionMBLComponent": AtlanticDomesticHotWaterProductionMBLComponent, | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions
20
homeassistant/components/overkiz/water_heater_entities/__init__.py
This file was deleted.
Oops, something went wrong.