From af2b8ffce61ea100f2883886dffd1f26876e9129 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 30 Nov 2026 21:50:58 +0100 Subject: [PATCH] Use the action field enums in evil_genius_labs (#195644) --- homeassistant/components/evil_genius_labs/light.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/evil_genius_labs/light.py b/homeassistant/components/evil_genius_labs/light.py index c58da627ab0b..48ce30178dac 100644 --- a/homeassistant/components/evil_genius_labs/light.py +++ b/homeassistant/components/evil_genius_labs/light.py @@ -3,8 +3,12 @@ import asyncio from typing import Any, cast, override -from homeassistant.components import light -from homeassistant.components.light import ColorMode, LightEntity, LightEntityFeature +from homeassistant.components.light import ( + ColorMode, + LightEntity, + LightEntityFeature, + LightServiceArgument, +) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -89,16 +93,16 @@ class EvilGeniusLight(EvilGeniusEntity, LightEntity): **kwargs: Any, ) -> None: """Turn light on.""" - if (brightness := kwargs.get(light.ATTR_BRIGHTNESS)) is not None: + if (brightness := kwargs.get(LightServiceArgument.BRIGHTNESS)) is not None: async with asyncio.timeout(5): await self.coordinator.client.set_path_value("brightness", brightness) # Setting a color will change the effect to "Solid Color" so skip setting effect - if (rgb_color := kwargs.get(light.ATTR_RGB_COLOR)) is not None: + if (rgb_color := kwargs.get(LightServiceArgument.RGB_COLOR)) is not None: async with asyncio.timeout(5): await self.coordinator.client.set_rgb_color(*rgb_color) - elif (effect := kwargs.get(light.ATTR_EFFECT)) is not None: + elif (effect := kwargs.get(LightServiceArgument.EFFECT)) is not None: if effect == HA_NO_EFFECT: effect = FIB_NO_EFFECT async with asyncio.timeout(5):