Use the action field enums in liebherr (#195940)

This commit is contained in:
epenet
2026-12-02 08:56:03 +01:00
committed by GitHub
parent d0b7259a6c
commit 8a7c5be0ef
+5 -3
View File
@@ -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