HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: dstclair on January 15, 2017, 07:13:11 AM

Title: Turn Off Delay improvement
Post by: dstclair on January 15, 2017, 07:13:11 AM
I had found it annoying if you have a turn off delay for say an hour, and you turned off your switch at 45 minutes, turned it back on at 50 minutes, 10 minutes later your switch would turn off.

I added program store tracking so that when the switch is turned on a target time (now + pause delay) value is saved. Subsequent calls update that, and the RunAsyncTask call has a value in it of the target time it was set to when that RunAsyncTask was initially called. If it doesn't match the current target time, it doesn't shut off the lights.