mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the action field enums in led_infrared (#195938)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user