Use the action field enums in ecobee (#195615)

This commit is contained in:
epenet
2026-11-30 16:39:52 +00:00
committed by GitHub
parent 5282ce2988
commit 9dcb4625c8
+4 -6
View File
@@ -4,8 +4,6 @@ import collections
from typing import Any, override
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
FAN_AUTO,
FAN_ON,
PRESET_AWAY,
@@ -14,11 +12,11 @@ from homeassistant.components.climate import (
PRESET_SLEEP,
ClimateEntity,
ClimateEntityFeature,
ClimateServiceArgument,
HVACAction,
HVACMode,
)
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_HALVES,
PRECISION_TENTHS,
STATE_OFF,
@@ -629,9 +627,9 @@ class Thermostat(ClimateEntity):
@override
def set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
low_temp = kwargs.get(ATTR_TARGET_TEMP_LOW)
high_temp = kwargs.get(ATTR_TARGET_TEMP_HIGH)
temp = kwargs.get(ATTR_TEMPERATURE)
low_temp = kwargs.get(ClimateServiceArgument.TARGET_TEMP_LOW)
high_temp = kwargs.get(ClimateServiceArgument.TARGET_TEMP_HIGH)
temp = kwargs.get(ClimateServiceArgument.TEMPERATURE)
if self.hvac_mode == HVACMode.HEAT_COOL and (
low_temp is not None or high_temp is not None