diff --git a/homeassistant/components/duotecno/climate.py b/homeassistant/components/duotecno/climate.py index 08ba29ffca16..3ddc2c7f9611 100644 --- a/homeassistant/components/duotecno/climate.py +++ b/homeassistant/components/duotecno/climate.py @@ -7,9 +7,10 @@ from duotecno.unit import SensUnit from homeassistant.components.climate import ( ClimateEntity, ClimateEntityFeature, + ClimateServiceArgument, HVACMode, ) -from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature +from homeassistant.const import UnitOfTemperature from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -82,7 +83,7 @@ class DuotecnoClimate(DuotecnoEntity, ClimateEntity): @override async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperatures.""" - if (temp := kwargs.get(ATTR_TEMPERATURE)) is None: + if (temp := kwargs.get(ClimateServiceArgument.TEMPERATURE)) is None: return await self._unit.set_temp(temp) diff --git a/homeassistant/components/duotecno/light.py b/homeassistant/components/duotecno/light.py index 00ed0347416f..6c4e35e07655 100644 --- a/homeassistant/components/duotecno/light.py +++ b/homeassistant/components/duotecno/light.py @@ -4,7 +4,7 @@ from typing import Any, override from duotecno.unit import DimUnit -from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity +from homeassistant.components.light import ColorMode, LightEntity, LightServiceArgument from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -46,7 +46,7 @@ class DuotecnoLight(DuotecnoEntity, LightEntity): @override async def async_turn_on(self, **kwargs: Any) -> None: """Instruct the light to turn on.""" - if (val := kwargs.get(ATTR_BRIGHTNESS)) is not None: + if (val := kwargs.get(LightServiceArgument.BRIGHTNESS)) is not None: # set to a value val = max(int((val * 100) / 255), 1) else: