Skip to content

Commit c59f83f

Browse files
committed
Bug fix(regression): some brightness values do not update the dimmer value in the HA
1 parent bb2a9d2 commit c59f83f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

inelsmqtt/devices/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,10 @@ def set_ha_value(self, value: Any) -> bool:
316316

317317
# This is a workaround to the last value before turn off since ramp increments are built into mqtt events
318318
if hasattr(value, 'light_coa_toa'):
319-
self.__state = dev.ha_value
320-
self.__values = dev
319+
_values = self.__values
320+
for i in range(6):
321+
_values.ha_value.light_coa_toa[i].brightness_before_off = value.light_coa_toa[i].brightness_before_off
322+
self.__values = _values
321323

322324
ret = False
323325
if self.__set_topic is not None:

inelsmqtt/protocols/cu3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ def create_ha_value_object(cls, device_value: DeviceValue) -> Any:
16641664
light_coa_toa.append(
16651665
LightCoaToa(
16661666
brightness=out[i],
1667-
brightness_before_off=device_value.last_value.ha_value.light_coa_toa[i].brightness_before_off if device_value.last_value else 0,
1667+
brightness_before_off=device_value.last_value.ha_value.light_coa_toa[i].brightness_before_off if device_value.last_value else None,
16681668
toa=toa[i],
16691669
coa=coa[i],
16701670
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name="elkoep-mqtt",
7-
version="0.2.33.beta.23",
7+
version="0.2.33.beta.24",
88
url="https://github.com/epdevlab/elkoep-mqtt",
99
license="MIT",
1010
author="Elko EP s.r.o.",

0 commit comments

Comments
 (0)