Skip to content
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

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

Open
HeneryH opened this issue Dec 20, 2024 · 2 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@HeneryH
Copy link

HeneryH commented Dec 20, 2024

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 HeneryH added bug Something isn't working needs-triage Needs looking at to decide what to do labels Dec 20, 2024
@HeneryH
Copy link
Author

HeneryH commented Dec 20, 2024

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.

@bartbutenaers
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

2 participants