mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
Add HVACAction state to palazzetti climate (#130502)
This commit is contained in:
parent
cd79a606d7
commit
58087d67d1
@ -7,6 +7,7 @@ from pypalazzetti.exceptions import CommunicationError, ValidationError
|
|||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
ClimateEntity,
|
ClimateEntity,
|
||||||
ClimateEntityFeature,
|
ClimateEntityFeature,
|
||||||
|
HVACAction,
|
||||||
HVACMode,
|
HVACMode,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
||||||
@ -82,8 +83,16 @@ class PalazzettiClimateEntity(
|
|||||||
@property
|
@property
|
||||||
def hvac_mode(self) -> HVACMode:
|
def hvac_mode(self) -> HVACMode:
|
||||||
"""Return hvac operation ie. heat or off mode."""
|
"""Return hvac operation ie. heat or off mode."""
|
||||||
is_heating = bool(self.coordinator.client.is_heating)
|
return HVACMode.HEAT if self.coordinator.client.is_on else HVACMode.OFF
|
||||||
return HVACMode.HEAT if is_heating else HVACMode.OFF
|
|
||||||
|
@property
|
||||||
|
def hvac_action(self) -> HVACAction:
|
||||||
|
"""Return hvac action ie. heating or idle."""
|
||||||
|
return (
|
||||||
|
HVACAction.HEATING
|
||||||
|
if self.coordinator.client.is_heating
|
||||||
|
else HVACAction.IDLE
|
||||||
|
)
|
||||||
|
|
||||||
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
||||||
"""Set new target hvac mode."""
|
"""Set new target hvac mode."""
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
'auto',
|
'auto',
|
||||||
]),
|
]),
|
||||||
'friendly_name': 'Stove',
|
'friendly_name': 'Stove',
|
||||||
|
'hvac_action': <HVACAction.HEATING: 'heating'>,
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.HEAT: 'heat'>,
|
<HVACMode.HEAT: 'heat'>,
|
||||||
<HVACMode.OFF: 'off'>,
|
<HVACMode.OFF: 'off'>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user