neilenns / node-red-contrib-wled2

NodeRed node for controlling WLED
MIT License
19 stars 8 forks source link

Change request - disable default values #80

Closed TheOriginalMrWolf closed 2 years ago

TheOriginalMrWolf commented 3 years ago

Hi there :)

It would be truly great if each of the properties of the Wled2 node were optional (ie checkbox next to each to enable/disable default values).

This would make certain use-cases a lot simpler and give a better user experience.

For instance - WLED is displaying an effect which was invoked via the WLED app. I would like to turn this off via NR by simply setting state = off, so that we get the same UX as doing so via the app or the web interface- eg, simply fades to black.

Unfortunately, with current implementation, I can't do that. If I send a message with only msg.payload.state = "off" then effect stops, switches to Solid effect, sets a colour, and only then turns off -- all of which is a little sub-optimal ;). And I can't set state to be the existing state, as I have no way of knowing the current state (see issue #79).

I can get the desired result by invoking the API directly, however that defeats the purpose of having this node in the first place!

Hope that's do-able - thank you!

neilenns commented 3 years ago

Are there other situations where this is causing issues? Or just when setting payload to off?

TheOriginalMrWolf commented 3 years ago

Changing brightness, changing intensity, changing speed, changing any of the colours, and so on.

Thanks for looking at this so quickly!

DcFamas commented 3 years ago

Hey there, having the same fault. For example I want to change the brightness on my streamdeck to 50% and the color1 is red this flow will change also the color to white.

The json I use is literally

{"brightness":128}

would it be possible that just the brightness is changed?

Best regards :)

neilenns commented 3 years ago

Hey there, having the same fault. For example I want to change the brightness on my streamdeck to 50% and the color1 is red this flow will change also the color to white.

The json I use is literally

{"brightness":128}

would it be possible that just the brightness is changed?

Best regards :)

For something that simple I suggest just sending the command directly to WLED with an httprequest node. You're already building JSON anyway, and the JSON for the API is really straightforward.

DcFamas commented 3 years ago

Okay, haven't known about this opportunity. Now I use it. :) Thanks

neilenns commented 2 years ago

Closing old issues.