Adorkable / node-red-contrib-ui-led

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

Add ability to toggle glow effect around LED on and off from config panel #55

Closed AndreasHeine closed 3 years ago

AndreasHeine commented 3 years ago

22 Sep 09:33:59 - [info] Node-RED version: v1.1.3 22 Sep 09:33:59 - [info] Node.js version: v12.18.3 22 Sep 09:33:59 - [info] Windows_NT 10.0.18363 x64 LE

Unbenannt4

Unbenannt

if i inject a msg.glow = false the glow is still there!?

Unbenannt1 Unbenannt2 Unbenannt3

AndreasHeine commented 3 years ago

if set

const glow = false; //msg.glow;

glow is gone ...

yoiang commented 3 years ago

Hello @AndreasHeine ! To clarify is injecting a glow false of false turning it off or is it still on?

Internally the control is passing glow amongst itself, and would overwrite values of glow someone sent further up the line. Perhaps the controls should internalize both the color and glow results in its own payload, hmmm!

AndreasHeine commented 3 years ago

injecting glow false does not turn the glow off! yes color too - at least its similar code

yoiang commented 3 years ago

Gotcha! Would you have expected it to? If you read through the README documentation glow and color aren't expected msg.payload values. Can you explain your usage so I can understand better and we can discuss what would make sense?

AndreasHeine commented 3 years ago

message object: msg.payload msg.glow msg.color

i would expect that the led glow updates on message!? at least i tought thats what the code looks like (i might be wrong)

yoiang commented 3 years ago

That code is internal to the node, the msg with glow and color are processed from the payload it receives and sent between different parts of the node (a result of the way Node-RED dashboard signals). The code isn't really a great way to learn how to use the node, the README is best!

README

AndreasHeine commented 3 years ago

if i look for example into the dashboard gauge its possible to change the sections on message same in some charts aswell. i normaly hardcode them off because i dont like the glow effect...

zaubererty commented 3 years ago

plus one

yoiang commented 3 years ago

So to clarify when you want to independent of the msg.payload value toggle the glow effect do you mean any coloration of the led or just the actual hazy glow around it?

AndreasHeine commented 3 years ago

both color and glow would be a awesome features!

dashboard gauge node:

if you want to change the colors of the sectors you can send a msg with a ui_contorl obj and empty payload obj to adjust the colors dynamic according to a setpoint

let upper = msg.payload * 1.04;
let lower = msg.payload * 0.95;

msg = {};
msg.ui_control = {seg1:lower||0,seg2:upper||0}
return msg;

Unbenannt

yoiang commented 3 years ago

Gotcha! I'm going to rename the issue accordingly for the glow, that would be new functionality.

Have you had a chance to read the documentation re: color definitions in the message (vs the default in the config panel): https://github.com/Adorkable/node-red-contrib-ui-led/blob/master/README.md#custom-statuses-in-msg . Let me know if that isn't enough, if there is some functionality regarding the colors that you don't think is covered here.

yoiang commented 3 years ago

The ability to disable the glow effect has been added to the node config panel in version 0.4.4!

Created a separate issue for toggling from msg.