mode-button-event: decrease interval, but update start time

This commit is contained in:
Christian Hesse 2018-10-11 22:39:25 +02:00
parent 1bbbe3a5a7
commit 28df37708c

View file

@ -8,7 +8,12 @@
:set ($"mode-button"->"count") ($"mode-button"->"count" + 1); :set ($"mode-button"->"count") ($"mode-button"->"count" + 1);
:if ([ :len [ / system scheduler find where name="mode-button-scheduler" ] ] = 0) do={ :local scheduler [ / system scheduler find where name="mode-button-scheduler" ];
:log info "Creating mode-button scheduler...";
/ system scheduler add name=mode-button-scheduler on-event=mode-button-scheduler interval=5s; :if ([ :len $scheduler ] = 0) do={
:log info "Creating mode-button scheduler, counting presses...";
/ system scheduler add name=mode-button-scheduler on-event=mode-button-scheduler interval=3s;
} else={
:log debug "Updating mode-button-scheduler...";
/ system scheduler set $scheduler start-time=[ /system clock get time ];
} }