Skip to content

[Bug]: Entity card is accepting jinja templates for icon_color #1521

Description

@lxffm

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest Mushroom version.
  • I did a search to see if there is a similar issue or if a pull request is open.
  • I have read the state of card mod support (in pin issues) and understand card mod support is not provided in this repository.

Current Behavior

Mushroom entity cards are not reactive to jinja templates e.g. for changing icon_colors based on values. It just leads to a white icon background with an black icon.

Expected Behavior

It's supposed to respect jinja templates and execute it's code.

Steps To Reproduce

  1. Create an mushroom entity card of your sensor.
  2. Add you icon color code
    e.g.
icon_color: |-
  {% set s = states('sensor.rasen_sensor_soil_humidity')|int %}
  {% if s > 50 %}
    light-green
  {% elif s <= 50 %}
    orange
  {% else %}
    red
  {% endif %}

Context

YAML state

Environment

- Browser: Chrome
- HA Version: 2024.8.3
- Mushroom: 4.0.5

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions