Documentation maybe? Custom Icons on Switch. Representing changing inputs as On/Off icons
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
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
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.
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:
And it is also mentioned in the documentation:
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:
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...