Skip to content

Commit bc48b4e

Browse files
committed
fix presentation light toggle
1 parent 7af1681 commit bc48b4e

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

custom_components/liebherr/light.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,21 @@ async def async_turn_on(
6464
) -> None:
6565
"""Turn the light on."""
6666

67+
# turn on via switch brightness not so will try to set to previous brightness
68+
# a brightness of zero won't turn on the light so turn on to max brightness
69+
brightness: int = (
70+
kwargs[ATTR_BRIGHTNESS]
71+
if kwargs[ATTR_BRIGHTNESS]
72+
else (self._attr_brightness if self._attr_brightness else 255)
73+
)
74+
6775
await self.coordinator.api.async_set_value(
6876
device_id=self._device.device_id,
6977
control=PresentationLightControlRequest(
70-
math.ceil(
71-
brightness_to_value(self.brightness_scale, kwargs[ATTR_BRIGHTNESS])
72-
)
78+
math.ceil(brightness_to_value(self.brightness_scale, brightness))
7379
),
7480
)
75-
self._attr_brightness = kwargs[ATTR_BRIGHTNESS]
81+
self._attr_brightness = brightness
7682
self._attr_is_on = True
7783
self.async_write_ha_state()
7884

custom_components/liebherr/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"loggers": ["pyliebherr"],
1313
"requirements": ["pyliebherr==2026.1.1", "Pillow>=11.0.0"],
1414
"single_config_entry": true,
15-
"version": "2026.1.3"
15+
"version": "2026.1.4"
1616
}

0 commit comments

Comments
 (0)