From 4a08b6b410958fe665864210879f0709e052adcd Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:05:38 +0100 Subject: [PATCH] Use the action field enums in niko_home_control (#196042) --- homeassistant/components/niko_home_control/climate.py | 9 ++++++--- homeassistant/components/niko_home_control/light.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/niko_home_control/climate.py b/homeassistant/components/niko_home_control/climate.py index 2c04b4047101..3ad2ff017ff5 100644 --- a/homeassistant/components/niko_home_control/climate.py +++ b/homeassistant/components/niko_home_control/climate.py @@ -9,9 +9,10 @@ from homeassistant.components.climate import ( PRESET_ECO, 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 @@ -69,8 +70,10 @@ class NikoHomeControlClimate(NikoHomeControlEntity, ClimateEntity): @override async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" - if ATTR_TEMPERATURE in kwargs: - await self._action.set_temperature(kwargs.get(ATTR_TEMPERATURE)) + if ClimateServiceArgument.TEMPERATURE in kwargs: + await self._action.set_temperature( + kwargs.get(ClimateServiceArgument.TEMPERATURE) + ) @override async def async_set_preset_mode(self, preset_mode: str) -> None: diff --git a/homeassistant/components/niko_home_control/light.py b/homeassistant/components/niko_home_control/light.py index 726df2fa4cae..055eb42fcb9f 100644 --- a/homeassistant/components/niko_home_control/light.py +++ b/homeassistant/components/niko_home_control/light.py @@ -6,9 +6,9 @@ from nhc.controller import NHCController from nhc.light import NHCLight from homeassistant.components.light import ( - ATTR_BRIGHTNESS, ColorMode, LightEntity, + LightServiceArgument, brightness_supported, ) from homeassistant.core import HomeAssistant @@ -53,7 +53,7 @@ class NikoHomeControlLight(NikoHomeControlEntity, LightEntity): @override async def async_turn_on(self, **kwargs: Any) -> None: """Instruct the light to turn on.""" - await self._action.turn_on(kwargs.get(ATTR_BRIGHTNESS)) + await self._action.turn_on(kwargs.get(LightServiceArgument.BRIGHTNESS)) @override async def async_turn_off(self, **kwargs: Any) -> None: