mrgadget / node-red-contrib-eztimer

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

Allow pass through of _linkSource for link call nodes #54

Closed LaurenceKaye closed 2 years ago

LaurenceKaye commented 2 years ago

Allows the node to be used in conjunction with a link call node by passing the linkSource through so the link out node knows where to return the data to.

mrgadget commented 2 years ago

Hey, thanks for the PR - interested in your use case.

My thoughts were this node doesn't normally pass a message in a flow - it accepts messages for programmatic changes, and emits messages for actions - but the two aren't really related.

Happy to discuss though.

LaurenceKaye commented 2 years ago

Yeah I was thinking the same when I was trying to use it, that really it only emitted when it needed to.

I have my schedules set up in a separate flow and they will happily run as they are. I've started added switches around the house that in certain situations, I only want them to turn off the lights when they aren't currently supposed to be on as per the schedule, so for this I use a link call node to probe the schedule in the other flow.

I could have picked up on the linkSource at the start of my link flow and set it to a flow variable but having to manage and clean it up separately seemed a bit messy so I opted to let the eztimer emit the linkSource when asked for 'info'.

Thoughts? :)

mrgadget commented 2 years ago

Ah info, yes you're right, that's an in-flow usage for sure. Makes sense to me; I'll have a look at the code and merge it.