Use the action field enums in izone (#195810)

This commit is contained in:
epenet
2026-12-02 19:46:55 +08:00
committed by GitHub
parent 47c32cf2de
commit d034c013b9
+4 -8
View File
@@ -18,14 +18,10 @@ from homeassistant.components.climate import (
PRESET_NONE,
ClimateEntity,
ClimateEntityFeature,
ClimateServiceArgument,
HVACMode,
)
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_HALVES,
PRECISION_TENTHS,
UnitOfTemperature,
)
from homeassistant.const import PRECISION_HALVES, PRECISION_TENTHS, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import entity_registry as er
@@ -366,7 +362,7 @@ class ControllerDevice(IZoneCoordinatorEntity, ClimateEntity):
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
if (temp := kwargs.get(ATTR_TEMPERATURE)) is not None:
if (temp := kwargs.get(ClimateServiceArgument.TEMPERATURE)) is not None:
temp = _normalize_setpoint(temp)
await self._async_run_and_update(self.controller.set_temp_setpoint(temp))
@@ -524,7 +520,7 @@ class ZoneDevice(IZoneCoordinatorEntity, ClimateEntity):
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
if (temp := kwargs.get(ATTR_TEMPERATURE)) is not None:
if (temp := kwargs.get(ClimateServiceArgument.TEMPERATURE)) is not None:
temp = _normalize_setpoint(temp)
await self._async_run_and_update(self._zone.set_temp_setpoint(temp))