Add hvac_action property to Senz (#77413)

Add hvac_action property
pull/77555/head
Åke Strandberg 2022-08-30 16:27:42 +02:00 committed by GitHub
parent f9eee0e9d7
commit 640d8b40f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -6,7 +6,11 @@ from typing import Any
from aiosenz import MODE_AUTO, Thermostat
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
from homeassistant.components.climate.const import (
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS
from homeassistant.core import HomeAssistant, callback
@ -85,6 +89,11 @@ class SENZClimate(CoordinatorEntity, ClimateEntity):
return HVACMode.AUTO
return HVACMode.HEAT
@property
def hvac_action(self) -> HVACAction:
"""Return current hvac action."""
return HVACAction.HEATING if self._thermostat.is_heating else HVACAction.IDLE
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new target hvac mode."""
if hvac_mode == HVACMode.AUTO: