node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

Documentation maybe? Custom Icons on Switch. Representing changing inputs as On/Off icons

Open HeneryH opened this issue 1 year ago • 2 comments

Current Behavior

I want to take a value from a flow and pass it to the switch as an input and then have the custom on/off icons. For example if a lock state changes from locked to unlocked or vice versus.

The documentation shows a string input on msg.payload should initiate the icon change.

I cannot get it to work. Tried string "on" and "off". Tried boolean true/false. What input format and values would make the icon change?

Expected Behavior

No response

Steps To Reproduce

2024-12-20 10_18_37-Node-RED _ Flow 1 - Brave

Environment

  • Dashboard version: 3.6.5
  • Node-RED version: 4.0.5
  • Node.js version:
  • npm version:
  • Platform/OS: Docker on Ubuntu
  • Browser:

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

HeneryH avatar Dec 20 '24 15:12 HeneryH

Ah, while inspecting the results I see that the browser is seeing that the icons are getting prefixed with "mdi-" so therefore only material icons can be used. At least that is what I am seeing. Works with material icons.

HeneryH avatar Dec 20 '24 17:12 HeneryH

Hi @HeneryH,

If you click on the node and look at the info panel sidebar, you will see indeed that Material icons are being used:

image

And it is also mentioned in the documentation:

image

But I have admit that I made the same mistake when I started with dashboard D2, because I was so getting used of the FontAwesome icons being used in Node-RED itself.

But yes you are right that it is not really mentioned in the part of the documentation that explains the dynamic injected properties:

image

However I am not sure if it would be more clear if there would be an "car" in that example column? Because then you still don't know that you need to specify an mdi icon string...

bartbutenaers avatar Dec 21 '24 06:12 bartbutenaers