mrgadget / node-red-contrib-eztimer

A simple-yet-flexible timer/scheduler for node-red
MIT License
13 stars 6 forks source link

Possibility to turn on/off/cancel missing in "programatic control" #38

Closed petter-b closed 3 years ago

petter-b commented 4 years ago

I just started to use this node. Although I found it quite useful I also found some potential for improvement.

Have the need to suspend the scheduling and at the same time make sure that the device controlled by the timer is turned on. To do this I figured that you need to first send a message with payload = "on" and then send another message with payload.suspend = true.

I suggest that you add "turn_on", "turn_off" and "cancel" as new options under "programatic control".

mrgadget commented 4 years ago

I see your use-case, no doubt. What about an action property that accepts the same commands as you'd normally use - so you could use a single message with the following payload:

"payload": {
    "action": "on",
    "suspended": true
}
petter-b commented 4 years ago

Sure, this would be neat solution.

mrgadget commented 4 years ago

Hey - would appreciate if you could give this a shot and report back before I push it out to the wider user-base.

It's not in NPM yet, so you'll need to grab index.js and index.html and replace them in the node on your system.

Thanks!

mrgadget commented 3 years ago

1.2.5 published to npm and pulled through to Node-RED packages.