mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
Fix errors in HitachiDHW in Overkiz (#133765)
* Small changes to fix errors in DHW * Update * Bugfix in float/int mistake * Fix typing * Fix code style * Fix mypy
This commit is contained in:
parent
cdd73a5c5a
commit
56b58cec3e
@ -48,8 +48,10 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
|
|||||||
def current_temperature(self) -> float | None:
|
def current_temperature(self) -> float | None:
|
||||||
"""Return the current temperature."""
|
"""Return the current temperature."""
|
||||||
current_temperature = self.device.states[OverkizState.CORE_DHW_TEMPERATURE]
|
current_temperature = self.device.states[OverkizState.CORE_DHW_TEMPERATURE]
|
||||||
if current_temperature:
|
|
||||||
return current_temperature.value_as_float
|
if current_temperature and current_temperature.value_as_int:
|
||||||
|
return float(current_temperature.value_as_int)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -58,13 +60,14 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
|
|||||||
target_temperature = self.device.states[
|
target_temperature = self.device.states[
|
||||||
OverkizState.MODBUS_CONTROL_DHW_SETTING_TEMPERATURE
|
OverkizState.MODBUS_CONTROL_DHW_SETTING_TEMPERATURE
|
||||||
]
|
]
|
||||||
if target_temperature:
|
|
||||||
return target_temperature.value_as_float
|
if target_temperature and target_temperature.value_as_int:
|
||||||
|
return float(target_temperature.value_as_int)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
async def async_set_temperature(self, **kwargs: Any) -> None:
|
async def async_set_temperature(self, **kwargs: Any) -> None:
|
||||||
"""Set new target temperature."""
|
"""Set new target temperature."""
|
||||||
|
|
||||||
await self.executor.async_execute_command(
|
await self.executor.async_execute_command(
|
||||||
OverkizCommand.SET_CONTROL_DHW_SETTING_TEMPERATURE,
|
OverkizCommand.SET_CONTROL_DHW_SETTING_TEMPERATURE,
|
||||||
int(kwargs[ATTR_TEMPERATURE]),
|
int(kwargs[ATTR_TEMPERATURE]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user