-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On-screen shape and fill color #2
base: master
Are you sure you want to change the base?
Conversation
Enhancement to allow both the shape and the fill color to be specified in the properties view. These on-screen properties can be overruled by the message properties.
Enhancement to allow both the shape and the fill color to be specified in the properties view. These on-screen properties can be overruled by the message properties.
Enhancement to allow both the shape and the fill color to be specified in the properties view. These on-screen properties can be overruled by the message properties.
Bart, by default we prefer the msg to only override properties if the property is not set in the config. I.E. if the user has specified something that is what it should be. |
Screen properties (set by user) have higher priority than message properties: both for shape and fill.
Screen properties (set by user) have higher priority than message properties: both for shape and fill.
I've added a small change to make sure the config properties (when set) will override the message properties, and not the other way around. The readme.md file is also updated. Kind regards, |
Hello,
By reading your messages, I can see that rules for overriding require more messages 👍 👎 ! As I don't want to be too restrictive, I think a way to solve this is to add a special "overridable" flag to trigger a behaviour or the other... What to you think of that? |
Dear Jacques (@Jacques44), Thanks for responding ! Good question. Some of my own contributions also behave like yours: if the msg contains some configuration, it will override the default behaviour from the user config. Didn't knew at the time being that the preferred Node-Red behaviour was the other way around ... And now I cannot change it anymore, otherwise existing flows would become corrupt ;-( For my new contributions I will take into account there standard. The checkbox might indeed solve the issue. But then your contribution is also not following 100% the Node-Red standard ... So it might be enough to add an extra note to your node's help info (to indicate which setting has highest priority). But perhaps you or @dceejay have another idea about this. Or perhaps you could post this question on the forum, because we won't be the only 2 contributors on this planet wondering how to solve this. Kind regards, |
Hi @bartbutenaers @Jacques44 @dceejay, I have just come across the bigstatus node after a quick search on a way to show something visual on the Node-RED flow page, and it appeared like a very good node to use for my purposes. I could not see if a quick way to set the shape and color of the icon was possible, as clearly this is something that your other "big nodes" do by the default, and since I wanted a quick and easy way to also have an icon displayed. From what I can @bartbutenaers has found a quick way to do it, albeit it's a static shape and color for what I can see, rather then dependent on the value of the message passed. I would love to see this pull request merged, to try to use it, unless @Jacques44 would rather keep this nifty feature out of his code, in order to leverage the control of the icon upstream. Thanks, Luca |
Disregard my comment, it's not worth to effort to rehash this. A quick function node is more than enough, and it can be used to have the choice of color and shape of the node status icon directly in one single node. The examples in the node description page were good enough for me, a relative newbie to Node-RED. Thanks, Luca |
Dear Jacques (@Jacques44),
Thanks for sharing this contribution!
In my current case, my messages only contain the status text (but no shape or fill color). E.g. when I select a new scene in my dashboard ('at home', 'sleeping', 'at work', ...), a 'blue ring' should be displayed for all these scenes.
To accomplish this, I have added two dropdowns to your properties screen:
To make sure that no existing flows are broken by this enhancement, I used following approach:
msg.fill
or amsg.shape
field, those fields will overrule the dropdown values.Here is my test flow:
Hopefully you like this contribution.
Hope to hear from you soon !
Kind regards,
Bart