Use the action field enums in led_infrared (#195938)

This commit is contained in:
epenet
2026-12-02 08:56:27 +01:00
committed by GitHub
parent 8a7c5be0ef
commit 0b951b4231
@@ -4,10 +4,10 @@ from typing import Any, override
from homeassistant.components.infrared import InfraredEmitterConsumerEntity
from homeassistant.components.light import (
ATTR_EFFECT,
ColorMode,
LightEntity,
LightEntityFeature,
LightServiceArgument,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
@@ -185,7 +185,7 @@ class LEDIrLightEntity(LEDIrBaseEntity, InfraredEmitterConsumerEntity, LightEnti
"""Turn device on."""
await self._send_command(self._codes["ON"].to_command())
self._attr_is_on = True
effect: str | None = kwargs.get(ATTR_EFFECT)
effect: str | None = kwargs.get(LightServiceArgument.EFFECT)
if effect and effect in self._attr_effect_list:
await self._send_command(self._codes[effect.upper()].to_command())
self._attr_effect = effect