21.09.2023, 14:45
Should be something like this:
You need to attach the same script to both brightness and color temp value objects. grp.getvalue should be used because event.getvalue only returns the value of the object that triggered the event.
Code:
br = grp.getvalue('1/5/10')
ct = grp.getvalue('1/0/14')
ww = (100 - ct) * br / 100 -- warm white value (0..100%)
cw = ct * br / 100 -- cold white value (0..100%)
grp.write('32/6/1', cw)
grp.write('32/6/2', ww)
You need to attach the same script to both brightness and color temp value objects. grp.getvalue should be used because event.getvalue only returns the value of the object that triggered the event.