This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

detect double, single and long press from wall switch
#3
(10.07.2015, 13:39)admin Wrote: Good job, though you can do it without any event-based scripts Smile

Some suggestions:
1. You don't need to use storage inside of resident script as variables are kept between each call. You can simply use a Lua table to store timer values for each group address.
2. You should use storage instead of grp.update for counters as you don't need to display this info in visualization or pass it to gateways.

According to second suggestion: I need to update counter object because second script (the one that turns on the lights) runs on updating it. Is it possible to tie lua script to storage variable so I can run script when variable changes?
Reply


Messages In This Thread
RE: detect double, single and long press from wall switch - by janbart - 10.07.2015, 13:55

Forum Jump: