diff --git a/homeassistant/components/unifiprotect/light.py b/homeassistant/components/unifiprotect/light.py index 91120e96a7e9..8783243fc599 100644 --- a/homeassistant/components/unifiprotect/light.py +++ b/homeassistant/components/unifiprotect/light.py @@ -11,7 +11,7 @@ from uiprotect.data import ( ) from uiprotect.data.public_devices import PublicLight -from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity +from homeassistant.components.light import ColorMode, LightEntity, LightServiceArgument from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -140,7 +140,7 @@ class ProtectLight(ProtectDeviceEntity, LightEntity): @override async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" - brightness = kwargs.get(ATTR_BRIGHTNESS) + brightness = kwargs.get(LightServiceArgument.BRIGHTNESS) led_level: int | None = None if brightness is not None: led_level = hass_to_unifi_brightness(brightness) diff --git a/homeassistant/components/unifiprotect/siren.py b/homeassistant/components/unifiprotect/siren.py index c588ecd6ef1a..dd2ea73e1c8b 100644 --- a/homeassistant/components/unifiprotect/siren.py +++ b/homeassistant/components/unifiprotect/siren.py @@ -6,11 +6,10 @@ from typing import Any, cast, override from uiprotect.data import PublicDeviceModel, Siren, SirenDuration from homeassistant.components.siren import ( - ATTR_DURATION, - ATTR_VOLUME_LEVEL, SirenEntity, SirenEntityDescription, SirenEntityFeature, + SirenServiceArgument, ) from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError, ServiceValidationError @@ -101,8 +100,8 @@ class ProtectSiren(ProtectDeviceEntity, SirenEntity): translation_key="siren_not_available", ) - duration: int | None = kwargs.get(ATTR_DURATION) - volume_level: float | None = kwargs.get(ATTR_VOLUME_LEVEL) + duration: int | None = kwargs.get(SirenServiceArgument.DURATION) + volume_level: float | None = kwargs.get(SirenServiceArgument.VOLUME_LEVEL) # Validate duration first (synchronous) before making any API calls. norm_duration: SirenDuration | None = None