mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the action field enums in kulersky (#195820)
This commit is contained in:
@@ -6,12 +6,7 @@ from typing import Any, override
|
||||
import pykulersky
|
||||
|
||||
from homeassistant.components import bluetooth
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_RGBW_COLOR,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.components.light import ColorMode, LightEntity, LightServiceArgument
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_ADDRESS
|
||||
from homeassistant.core import HomeAssistant
|
||||
@@ -80,10 +75,10 @@ class KulerskyLight(LightEntity):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Instruct the light to turn on."""
|
||||
default_rgbw = (255,) * 4 if self.rgbw_color is None else self.rgbw_color
|
||||
rgbw = kwargs.get(ATTR_RGBW_COLOR, default_rgbw)
|
||||
rgbw = kwargs.get(LightServiceArgument.RGBW_COLOR, default_rgbw)
|
||||
|
||||
default_brightness = 0 if self.brightness is None else self.brightness
|
||||
brightness = kwargs.get(ATTR_BRIGHTNESS, default_brightness)
|
||||
brightness = kwargs.get(LightServiceArgument.BRIGHTNESS, default_brightness)
|
||||
|
||||
if brightness == 0 and not kwargs:
|
||||
# If the light would be off, and no additional parameters were
|
||||
|
||||
Reference in New Issue
Block a user