mirror of
https://github.com/home-assistant/core.git
synced 2026-12-05 21:29:58 -04:00
Migrate overkiz water heater to native temperature properties (#184746)
This commit is contained in:
+3
-3
@@ -41,7 +41,7 @@ OPERATION_MODE_TO_OVERKIZ = {v: k for k, v in OVERKIZ_TO_OPERATION_MODE.items()}
|
||||
class AtlanticDomesticHotWaterProductionIOComponent(OverkizEntity, WaterHeaterEntity):
|
||||
"""Representation of io:AtlanticDomesticHotWaterProductionIOComponent."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_translation_key = DOMAIN
|
||||
_attr_target_temperature_step = TARGET_TEMPERATURE_STEP
|
||||
_attr_supported_features = (
|
||||
@@ -75,7 +75,7 @@ class AtlanticDomesticHotWaterProductionIOComponent(OverkizEntity, WaterHeaterEn
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float | None:
|
||||
def native_current_temperature(self) -> float | None:
|
||||
"""Return the current temperature."""
|
||||
if current_temp := self.device.states.get(OverkizState.CORE_TEMPERATURE):
|
||||
return current_temp.value_as_float
|
||||
@@ -84,7 +84,7 @@ class AtlanticDomesticHotWaterProductionIOComponent(OverkizEntity, WaterHeaterEn
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float | None:
|
||||
def native_target_temperature(self) -> float | None:
|
||||
"""Return the target temperature."""
|
||||
if target_temp := self.device.states.get(OverkizState.CORE_TARGET_TEMPERATURE):
|
||||
return target_temp.value_as_float
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ from ..entity import OverkizEntity
|
||||
class AtlanticDomesticHotWaterProductionMBLComponent(OverkizEntity, WaterHeaterEntity):
|
||||
"""Representation of AtlanticDomesticHotWaterProductionMBLComponent (modbuslink)."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
| WaterHeaterEntityFeature.OPERATION_MODE
|
||||
@@ -56,7 +56,7 @@ class AtlanticDomesticHotWaterProductionMBLComponent(OverkizEntity, WaterHeaterE
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float:
|
||||
def native_current_temperature(self) -> float:
|
||||
"""Return the current temperature."""
|
||||
return cast(
|
||||
float,
|
||||
@@ -67,7 +67,7 @@ class AtlanticDomesticHotWaterProductionMBLComponent(OverkizEntity, WaterHeaterE
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float:
|
||||
def native_target_temperature(self) -> float:
|
||||
"""Return the temperature corresponding to the PRESET."""
|
||||
return cast(
|
||||
float,
|
||||
|
||||
+3
-3
@@ -75,7 +75,7 @@ class AtlanticDomesticHotWaterProductionV2CEFLATC2IOComponent(
|
||||
):
|
||||
"""Representation of io:AtlanticDomesticHotWaterProductionV2_CE_FLAT_C2_IOComponent."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_translation_key = DOMAIN
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
@@ -106,7 +106,7 @@ class AtlanticDomesticHotWaterProductionV2CEFLATC2IOComponent(
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float | None:
|
||||
def native_current_temperature(self) -> float | None:
|
||||
"""Return the current temperature."""
|
||||
if current_temp := self.device.states.get(
|
||||
OverkizState.IO_MIDDLE_WATER_TEMPERATURE
|
||||
@@ -116,7 +116,7 @@ class AtlanticDomesticHotWaterProductionV2CEFLATC2IOComponent(
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float | None:
|
||||
def native_target_temperature(self) -> float | None:
|
||||
"""Return the target temperature."""
|
||||
if target_temp := self.device.states.get(
|
||||
OverkizState.CORE_WATER_TARGET_TEMPERATURE
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ DHWP_AWAY_MODES = [
|
||||
class AtlanticDomesticHotWaterProductionV2IOComponent(OverkizEntity, WaterHeaterEntity):
|
||||
"""Representation of AtlanticDomesticHotWaterProductionV2IOComponent (io)."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
| WaterHeaterEntityFeature.OPERATION_MODE
|
||||
@@ -69,7 +69,7 @@ class AtlanticDomesticHotWaterProductionV2IOComponent(OverkizEntity, WaterHeater
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float:
|
||||
def native_current_temperature(self) -> float:
|
||||
"""Return the current temperature."""
|
||||
|
||||
return cast(
|
||||
@@ -81,7 +81,7 @@ class AtlanticDomesticHotWaterProductionV2IOComponent(OverkizEntity, WaterHeater
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float:
|
||||
def native_target_temperature(self) -> float:
|
||||
"""Return the temperature corresponding to the PRESET."""
|
||||
|
||||
return cast(
|
||||
|
||||
@@ -20,7 +20,7 @@ from ..entity import OverkizEntity
|
||||
class AtlanticPassAPCDHW(OverkizEntity, WaterHeaterEntity):
|
||||
"""Representation of Atlantic Pass APC DHW."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
| WaterHeaterEntityFeature.OPERATION_MODE
|
||||
@@ -30,7 +30,7 @@ class AtlanticPassAPCDHW(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float:
|
||||
def native_target_temperature(self) -> float:
|
||||
"""Return the temperature corresponding to the PRESET."""
|
||||
if self.is_boost_mode_on:
|
||||
return cast(
|
||||
|
||||
@@ -41,7 +41,7 @@ DEFAULT_MAX_TEMP: float = 70
|
||||
class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
||||
"""Representation of a DomesticHotWaterProduction Water Heater."""
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
| WaterHeaterEntityFeature.OPERATION_MODE
|
||||
@@ -178,7 +178,7 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float | None:
|
||||
def native_current_temperature(self) -> float | None:
|
||||
"""Return the current temperature."""
|
||||
current_temperature = self.device.states.get(
|
||||
OverkizState.IO_MIDDLE_WATER_TEMPERATURE
|
||||
@@ -194,7 +194,7 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float | None:
|
||||
def native_target_temperature(self) -> float | None:
|
||||
"""Return the temperature we try to reach."""
|
||||
|
||||
target_temperature = self.device.states.get(
|
||||
@@ -219,7 +219,7 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature_high(self) -> float | None:
|
||||
def native_target_temperature_high(self) -> float | None:
|
||||
"""Return the highbound target temperature we try to reach."""
|
||||
target_temperature_high = self.device.states.get(
|
||||
OverkizState.CORE_MAXIMAL_TEMPERATURE_MANUAL_MODE
|
||||
@@ -230,7 +230,7 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature_low(self) -> float | None:
|
||||
def native_target_temperature_low(self) -> float | None:
|
||||
"""Return the lowbound target temperature we try to reach."""
|
||||
target_temperature_low = self.device.states.get(
|
||||
OverkizState.CORE_MINIMAL_TEMPERATURE_MANUAL_MODE
|
||||
|
||||
@@ -36,7 +36,7 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
|
||||
_attr_max_temp = 70.0
|
||||
_attr_precision = PRECISION_WHOLE
|
||||
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features = (
|
||||
WaterHeaterEntityFeature.TARGET_TEMPERATURE
|
||||
| WaterHeaterEntityFeature.OPERATION_MODE
|
||||
@@ -45,7 +45,7 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_temperature(self) -> float | None:
|
||||
def native_current_temperature(self) -> float | None:
|
||||
"""Return the current temperature."""
|
||||
current_temperature = self.device.states.get(OverkizState.CORE_DHW_TEMPERATURE)
|
||||
|
||||
@@ -56,7 +56,7 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
|
||||
|
||||
@property
|
||||
@override
|
||||
def target_temperature(self) -> float | None:
|
||||
def native_target_temperature(self) -> float | None:
|
||||
"""Return the temperature we try to reach."""
|
||||
target_temperature = self.device.states.get(
|
||||
OverkizState.MODBUS_CONTROL_DHW_SETTING_TEMPERATURE
|
||||
|
||||
Reference in New Issue
Block a user