Node-red-contrib-later - maintenance feedback wanted


#1

Hi everyone,
I have been a bit slack on maintaining this node as it has been doing what I need but I noticed some outstanding issues I have some time to sort...

  1. Resetting/cancelling schedules
    As it stands until a schedule runs once you can't cancel it. Two options I can see here. Add another output that sends the id of the schedule on creation that could be captured and saved to remove the timer before firing. Maybe a checkbox option to enable it....
    The other is check for msg.later.reset boolean on input that would clear all of the current schedules. This is the easiest to implement, and keeps the node 'clean', one input one output, downside for those feeding multiple schedules no selectivity. Thoughts, comments, other options most welcome.

  2. Sunset/sunrise option
    I like the idea of this, BUT it involves introducing another dependancy (like suncalc), location or at least lattitude config and some sort of hack/fudge to make it work with the underlying later lib. Is it worth it? I am on the side of just closing off this issue, as there are other solutions for anyone needing this. Again all inputs welcome...

  3. Error handling
    I wrote this node before the 'catch' node existed so I used node.warn() to indicate errors as I didn't want to throw an error that would stop the runtime. Now we have a catch system, does it make more sense to throw an error that a user can catch and respond to? I am thinking of just upgrading the error calls to node.error() and users can deal with that using catch.

Looking forward to your thoughts.


#2

Hi @d-o - long time no see !

I would go for the simple option to start with - then enhance again later if required... so a simple reset

  1. On some of the other nodes - like delay and trigger we just look for msg.reset so you could adopt that 'standard' :slight_smile:
  2. Indeed - maybe worth a quick think about how you could combine with (say) the suncalc node to best effect - could it feed to you ? or you to it ? If it to you - would it need anything added (to a property) so you would know what to do ?
  3. Yes - indeed - could do that - if they are real errors (don't forget the second param needed) - or if not really errors then the status node can 'catch' any node.status you provide under the node.