Hallo all,
I’d like to implement a timer (e.g. for a lamp) that switches off after a certain amount of time. Additionally, the remaining time should be displayed in my GUI and should be modifyable by a GUI click.
I understood the normal retriggerable timers like these: (works fine)
if(timerDimmer == null) {
timerDimmer = createTimer(now.plusSeconds(timeoutSeconds), [|
Dimmer.sendCommand(0)
timerDimmer = null
])
}
else {
timerDimmer.reschedule(now.plusSeconds(timeoutSeconds))
}
Questions:
1.) How can I show the remaining time in seconds in a gui widget? => This means how do I put the remaining time in an “auto-updated” item? Or alternatively, how can I put the ending time in an item?
2.) How can I extend/reduce the timer by clicking on my gui => This means how can I extend the timer by a e.g. switch item? How to connect that switch item or number item (or whatever) to the timer?
Thanks