Hello,
Once again, I'm in need of help. I'm trying to do a simple script that adds few %'s to a DALI light while holding dimming button. I have the button setup as dimmer (brighter), which gives value 9 when I hold it and value 0 when I don't. This is the script I came up with but of course it doesn't work. The loop doesn't break, it just keeps on going even after 100% and keeps updating it. This code is inside the dimming button.
12/0/0 = stm = DALI light object, which has a scale from 0-100%.
step = number of % it's supposed to jump each ramp_time
I even tried doing: if (value ~= 9) then break but it doesn't work. Any suggestions?
Once again, I'm in need of help. I'm trying to do a simple script that adds few %'s to a DALI light while holding dimming button. I have the button setup as dimmer (brighter), which gives value 9 when I hold it and value 0 when I don't. This is the script I came up with but of course it doesn't work. The loop doesn't break, it just keeps on going even after 100% and keeps updating it. This code is inside the dimming button.
12/0/0 = stm = DALI light object, which has a scale from 0-100%.
step = number of % it's supposed to jump each ramp_time
Code:
value = event.getvalue()
step = 4
ramp_time = 0.05
stm = grp.getvalue('12/0/0')
while (value == 9) do
stm = grp.getvalue('12/0/0')
grp.write('12/0/0', stm + step)
if (value == 0) then
break
end
os.sleep(ramp_time)
end
I even tried doing: if (value ~= 9) then break but it doesn't work. Any suggestions?