Use the action field enums in nobo_hub (#196050)

This commit is contained in:
epenet
2026-12-02 09:39:39 -05:00
committed by GitHub
parent b51c649348
commit f6023d3902
+4 -5
View File
@@ -5,14 +5,13 @@ from typing import Any, override
from pynobo import PynoboError, nobo
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
PRESET_AWAY,
PRESET_COMFORT,
PRESET_ECO,
PRESET_NONE,
ClimateEntity,
ClimateEntityFeature,
ClimateServiceArgument,
HVACMode,
)
from homeassistant.const import PRECISION_TENTHS, PRECISION_WHOLE, UnitOfTemperature
@@ -156,9 +155,9 @@ class NoboZone(NoboBaseEntity, ClimateEntity):
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
if ATTR_TARGET_TEMP_LOW in kwargs:
low = round(kwargs[ATTR_TARGET_TEMP_LOW])
high = round(kwargs[ATTR_TARGET_TEMP_HIGH])
if ClimateServiceArgument.TARGET_TEMP_LOW in kwargs:
low = round(kwargs[ClimateServiceArgument.TARGET_TEMP_LOW])
high = round(kwargs[ClimateServiceArgument.TARGET_TEMP_HIGH])
try:
await self._nobo.async_update_zone(
self._id, temp_comfort_c=high, temp_eco_c=low