Hi. I am trying to write something that turn my SwitchBinary off whenever it's been on for 120 minutes. I decided to use the app "TimerSwitch" for timer.
This is my first attempt to write any code so far. It does the job, but I don’t manage to close binding to the virtual device. And I seem to catch multiple true events from the SwitchBinary (dev17), which I think starts multiple bindings to the virtual device. Does anyone feel like reviewing my code and give me any pointers or suggestions?
I don't fully understand your answers, but I guess google/this forum could help me with "AutoOff", "outside handler", "module stop", etc that I guess is fundamentals of writing code.
Anyway, If you or someone else could help me to layout the design of the code it I would appreciate that very much.