[Bug]: template card not rendering icon and icon_color
See original GitHub issueCurrent Behavior
Template is not rendering for
- icon
- icon_color
However it renders properly for
- primary
- secondary
Expected Behavior
We expect it to render properly.
Steps To Reproduce
We have a presence integration that creates a sensor as follow
We’re using Template card like this
type: custom:mushroom-template-card
primary: '{{ states(''sensor.presence_REDACTED'') }}'
secondary: '{{ states[''sensor.presence_REDACTED''].attributes.availability }}'
icon: '{{ states[''sensor.presence_REDACTED''].attributes.icon }}'
icon_color: '{{ states[''sensor.presence_REDACTED''].attributes.color }}'
tap_action:
action: more-info
entity: sensor.presence_REDACTED
fill_container: false
As seen, availability
is an attribute similar to icon
and color
.
Code renders properly for secondary, but not for icon
or icon_color
In fact it break the rest of the rendering, and even primary / secondary don’t get displayed if icon and icon_color have the above code.
Environment
- OS: Ubuntu
- Browser: Chrome
- Version: 1.9.0
- Hassio: Home Assistant Core 2022.6.4
Home Assistant Supervisor 2022.05.3
Anything else?
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Struggling with card_mod not changing icon colour / color ...
I get the expected displayed card on my PC but when using the iPhone app or Android app the icon is blue and...
Read more >--card-mod-icon stopped working in Entities card · Issue #176 ...
I found that the --card-mod-icon stops working (or works sometimes after F5) in case of using a card-mod-theme. With the default theme or...
Read more >Mushroom chip card not changing icon color : r/homeassistant
Entity chips seem to have a bug or something. Are you on the latest version of mushroom? Here's my config for icon color...
Read more >SwiftUI - Unable to change color of Image icon - Stack Overflow
I'm not sure what are you trying to to achieve, but probably you just need template rendering mode, like. Image(self.icon) .
Read more >ion-item - Ionic Framework
ion-item elements for iOS/Android contain text, icons, images, and other custom elements. They're placed in a list and can be input, deleted, edited, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @piitaya it’s working all good now, and by the way, wonderful project. This issue can be resolved as None Issue
Apologies, it might be working, I think the attributes were not properly updated and it was throwing me off. I will do some troubleshooting and report back, I believe state_attr is good to use.