diff --git a/homeassistant/components/eheimdigital/climate.py b/homeassistant/components/eheimdigital/climate.py index 34755044e4aa..20ff14bbec20 100644 --- a/homeassistant/components/eheimdigital/climate.py +++ b/homeassistant/components/eheimdigital/climate.py @@ -10,15 +10,11 @@ from homeassistant.components.climate import ( PRESET_NONE, ClimateEntity, ClimateEntityFeature, + ClimateServiceArgument, HVACAction, 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.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -95,8 +91,10 @@ class EheimDigitalHeaterClimate(EheimDigitalEntity[EheimDigitalHeater], ClimateE @override async def async_set_temperature(self, **kwargs: Any) -> None: """Set a new temperature.""" - if ATTR_TEMPERATURE in kwargs: - await self._device.set_target_temperature(kwargs[ATTR_TEMPERATURE]) + if ClimateServiceArgument.TEMPERATURE in kwargs: + await self._device.set_target_temperature( + kwargs[ClimateServiceArgument.TEMPERATURE] + ) @exception_handler @override diff --git a/homeassistant/components/eheimdigital/light.py b/homeassistant/components/eheimdigital/light.py index 530eb3f2918e..a0b7a9388848 100644 --- a/homeassistant/components/eheimdigital/light.py +++ b/homeassistant/components/eheimdigital/light.py @@ -7,12 +7,11 @@ from eheimdigital.device import EheimDigitalDevice from eheimdigital.types import LightMode from homeassistant.components.light import ( - ATTR_BRIGHTNESS, - ATTR_EFFECT, EFFECT_OFF, ColorMode, LightEntity, LightEntityFeature, + LightServiceArgument, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -92,12 +91,18 @@ class EheimDigitalClassicLEDControlLight( @override async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the light.""" - if ATTR_EFFECT in kwargs: - await self._device.set_light_mode(EFFECT_TO_LIGHT_MODE[kwargs[ATTR_EFFECT]]) + if LightServiceArgument.EFFECT in kwargs: + await self._device.set_light_mode( + EFFECT_TO_LIGHT_MODE[kwargs[LightServiceArgument.EFFECT]] + ) return - if ATTR_BRIGHTNESS in kwargs: + if LightServiceArgument.BRIGHTNESS in kwargs: await self._device.turn_on( - int(brightness_to_value(BRIGHTNESS_SCALE, kwargs[ATTR_BRIGHTNESS])), + int( + brightness_to_value( + BRIGHTNESS_SCALE, kwargs[LightServiceArgument.BRIGHTNESS] + ) + ), self._channel, )