mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Fix current_operation when there is no operation_mode in Overkiz DHWP (#84077)
Fix current_operation when there is no operation_mode
This commit is contained in:
parent
d9903c4cf9
commit
5c272583e7
@ -251,19 +251,21 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_operation(self) -> str:
|
def current_operation(self) -> str | None:
|
||||||
"""Return current operation ie. eco, electric, performance, ..."""
|
"""Return current operation ie. eco, electric, performance, ..."""
|
||||||
if self._is_boost_mode_on:
|
if self._is_boost_mode_on:
|
||||||
return OVERKIZ_TO_OPERATION_MODE[OverkizCommandParam.BOOST]
|
return OVERKIZ_TO_OPERATION_MODE[OverkizCommandParam.BOOST]
|
||||||
|
|
||||||
return OVERKIZ_TO_OPERATION_MODE[
|
current_dwh_mode = cast(
|
||||||
cast(
|
str,
|
||||||
str,
|
self.executor.select_state(
|
||||||
self.executor.select_state(
|
OverkizState.IO_DHW_MODE, OverkizState.MODBUSLINK_DHW_MODE
|
||||||
OverkizState.IO_DHW_MODE, OverkizState.MODBUSLINK_DHW_MODE
|
),
|
||||||
),
|
)
|
||||||
)
|
if current_dwh_mode in OVERKIZ_TO_OPERATION_MODE:
|
||||||
]
|
return OVERKIZ_TO_OPERATION_MODE[current_dwh_mode]
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
async def async_set_operation_mode(self, operation_mode: str) -> None:
|
async def async_set_operation_mode(self, operation_mode: str) -> None:
|
||||||
"""Set new target operation mode."""
|
"""Set new target operation mode."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user