mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Use HAVCMode enum in BSB-Lan climate (#94638)
This commit is contained in:
parent
908f3386e7
commit
998a45879e
@ -23,6 +23,7 @@ from homeassistant.helpers.update_coordinator import (
|
|||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
DataUpdateCoordinator,
|
DataUpdateCoordinator,
|
||||||
)
|
)
|
||||||
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from . import HomeAssistantBSBLANData
|
from . import HomeAssistantBSBLANData
|
||||||
from .const import ATTR_TARGET_TEMPERATURE, DOMAIN, LOGGER
|
from .const import ATTR_TARGET_TEMPERATURE, DOMAIN, LOGGER
|
||||||
@ -112,12 +113,11 @@ class BSBLANClimate(
|
|||||||
return float(self.coordinator.data.target_temperature.value)
|
return float(self.coordinator.data.target_temperature.value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hvac_mode(self) -> str:
|
def hvac_mode(self) -> HVACMode | None:
|
||||||
"""Return hvac operation ie. heat, cool mode."""
|
"""Return hvac operation ie. heat, cool mode."""
|
||||||
if self.coordinator.data.hvac_mode.value == PRESET_ECO:
|
if self.coordinator.data.hvac_mode.value == PRESET_ECO:
|
||||||
return HVACMode.AUTO
|
return HVACMode.AUTO
|
||||||
|
return try_parse_enum(HVACMode, self.coordinator.data.hvac_mode.value)
|
||||||
return self.coordinator.data.hvac_mode.value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def preset_mode(self) -> str | None:
|
def preset_mode(self) -> str | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user