Adorkable / node-red-contrib-ui-led

A simple LED status indicator for the Node-RED Dashboard
MIT License
16 stars 12 forks source link

Consume similar payloads to Neopixel LED packets #39

Open Just-another-pleb opened 5 years ago

Just-another-pleb commented 5 years ago

Although getting away from a "simple" LED, the NEOPIXELs are popular.

For people wanting to simulate a Neopixel LED, adding that to the LED would/may/could be nice.

The input would be the same as the NeoPixel LEDs so as to maintain a standard so any code could easily be ported to the real ones.

yoiang commented 5 years ago

Can you describe what you would imagine a Neopixel like LED node would look and behave like?

Just-another-pleb commented 5 years ago

From the GUI side of things, just the same as the now existing ui_LED.

It would only need 1 input (the power pins are a given) and 1 output. As they are chainable.

You would send it a message with the RGB values from 0 - 128, as per the NexPixels, and it would display that value.

Alas it would go away from accepting names for colours, so maybe it may be better it is a whole new node as I do use colour names when I configure the existing ui_LED node.

Maybe - rather than sending it NeoPixel packets - you could send it a message something like:

msg.payload = {N: (value),R: (value), G: (value), B: (value)};

Where N is the number of the LED in the string.

yoiang commented 5 years ago

Hey @Just-another-pleb ! So our node supports any CSS valid color format as mentioned in the README, which means it does accept RGB values.

Adding support for a string of chained, indexed nodes feels like it adds complexity past a simple LED node's need. However if there is enough interest I could see an additional node that arranges, chains and indexes LED nodes how you're describing!

Just-another-pleb commented 5 years ago

Thanks for the replies.

Ok, I agree with most of what you say.

That leads me to a "new" idea:

Rather than add all this extra dependency on the other library, make a new node.

That way if the people are happy with the LED node as is, all is good.

If they want to add brightness, they install the new node and put it just before the LED.

That way the "sacrifice" of all the extra stuff is only done if needed. (the added size/burden of the code which mostly won't be used.)

yoiang commented 5 years ago

Yea, I agree! I'll think it over more and see if something clear comes through.