mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Use the action field enums in eufy (#195640)
This commit is contained in:
@@ -4,13 +4,7 @@ from typing import Any, override
|
||||
|
||||
import lakeside
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_COLOR_TEMP_KELVIN,
|
||||
ATTR_HS_COLOR,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.components.light import ColorMode, LightEntity, LightServiceArgument
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
@@ -109,9 +103,9 @@ class EufyHomeLight(LightEntity):
|
||||
@override
|
||||
def turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the specified light on."""
|
||||
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||
color_temp_kelvin = kwargs.get(ATTR_COLOR_TEMP_KELVIN)
|
||||
hs = kwargs.get(ATTR_HS_COLOR)
|
||||
brightness = kwargs.get(LightServiceArgument.BRIGHTNESS)
|
||||
color_temp_kelvin = kwargs.get(LightServiceArgument.COLOR_TEMP_KELVIN)
|
||||
hs = kwargs.get(LightServiceArgument.HS_COLOR)
|
||||
|
||||
if brightness is not None:
|
||||
brightness = int(brightness * 100 / 255)
|
||||
|
||||
Reference in New Issue
Block a user