23.05.2022, 08:30
(23.05.2022, 07:00)admin Wrote: Attach an event script to a 251.600 6 byte DALI RGBW object. The RGB part will control the color, W part will be the output brightness. Change R/G/B output addresses as needed.
Code:value = event.getvalue()
max = math.max(1, value.red, value.green, value.blue)
mult = value.white / max
red = math.round(value.red * mult)
green = math.round(value.green * mult)
blue = math.round(value.blue * mult)
grp.write('1/1/3', red, dt.uint8)
grp.write('1/1/4', green, dt.uint8)
grp.write('1/1/5', blue, dt.uint8)
So I understand that, first, I have to convert/combine my 3 x 1 byte RGB objects + 1 byte dimming value into a 6 bytes object just to run this script, isn't it? Can you help me to do it? Thank you!