mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the action field enums in liebherr (#195940)
This commit is contained in:
@@ -10,7 +10,7 @@ from pyliebherrhomeapi.const import (
|
||||
DEFAULT_PRESENTATION_LIGHT_MAX_BRIGHTNESS,
|
||||
)
|
||||
|
||||
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||
from homeassistant.components.light import ColorMode, LightEntity, LightServiceArgument
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
@@ -115,8 +115,10 @@ class LiebherrPresentationLight(LiebherrEntity, LightEntity):
|
||||
assert control is not None
|
||||
max_level = control.max or DEFAULT_PRESENTATION_LIGHT_MAX_BRIGHTNESS
|
||||
|
||||
if ATTR_BRIGHTNESS in kwargs:
|
||||
target = max(1, round(kwargs[ATTR_BRIGHTNESS] * max_level / 255))
|
||||
if LightServiceArgument.BRIGHTNESS in kwargs:
|
||||
target = max(
|
||||
1, round(kwargs[LightServiceArgument.BRIGHTNESS] * max_level / 255)
|
||||
)
|
||||
else:
|
||||
target = max_level
|
||||
|
||||
|
||||
Reference in New Issue
Block a user