lutzer / node-red-contrib-easing

MIT License
3 stars 2 forks source link

feature request: reset #8

Closed noumenon272 closed 3 years ago

noumenon272 commented 3 years ago

First off, this node has been great. thanks for creating it. I'm using to dim lights in home automation. Some of my dimming commands take a while to run however, so I'd like to be able to send a reset or stop payload to halt the easing function.

also, i would like to be able to specify the interval as well as the duration in a json payload.

thanks for your work

lutzer commented 3 years ago

hey. thank you.

to your second question. it is already possible to set the interval or payload in the message:

from the README.md:

If the msg.payload contains a JSON object in the format: { "from" : 1, "to" : 10, "duration": 200 }, it will ramp between these two values (<from>, <to>) within the given <duration> (in milliseconds).
If the msg.payload contains a JSON object in the format: { "from" : 1, "to" : 10, "size": 10 }, it will ramp between these two values (<from>, <to>), giving an array of <size> values.

is this what you had in mind?

About the reset, functionality: i will look into it. it shouldnt be any problem to add that extra functionality.

noumenon272 commented 3 years ago

Awesome! thanks for looking at it.

Maybe I’m not understanding, but I can’t figure out how to set the interval. I can set duration in a change node of say, 8000msec, but the only place I can set the interval is in the actual node. I’ve found that I am flooding my zigbee mesh network if I have the interval too fast. I need it to only update every 1000msec or more.

The size argument only seems to affect output as an array. If it outputs values over time the interval is still the value set in the node itself.

Thanks again

lutzer commented 3 years ago

I see. good point. i added that possibility in version 2.2. i also added the reset functionality. Its already published on npm, should be available tomorrow in the node red registry.