My Home Assistant version: 0.XX.X
2021.11
My lovelace configuration method (GUI or yaml):
yaml
What I am doing:
adding a section to card-mod-theme for changing state color on certain domains
What I expected to happen:
no warning in the logs
What happened instead:
Warnings in the homeassistant.log
2021-11-04 10:09:43 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'entity' when rendering 'state-badge {
{% if config.entity is match('(switch|automation|input_boolean|binary_sensor)', ignorecase=False) %}
{% if is_state(config.entity, 'on') %} color: var(--primary-color)
{% else %} color: steelblue
{% endif %};
{% endif %};
}'
Happening on each view change
Minimal steps to reproduce:
# The least amount of code possible to reproduce my error
card-mod-row-yaml: |
"*:first-child$": |
state-badge {
{% if config.entity is match('(switch|automation|input_boolean|binary_sensor)', ignorecase=False) %}
{% if is_state(config.entity, 'on') %} color: var(--primary-color)
{% else %} color: steelblue
{% endif %};
{% endif %};
}
# End of code
Error messages from the browser console:
Not sure if this is related, but there is:
Unhandled Promise Rejection: AbortError: The operation was aborted.
without very much to go on unfortunately
fwiw: the card-mod seems to work as intended ;-)
By putting an X in the boxes ([]) below, I indicate that I:
[X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.
My Home Assistant version: 0.XX.X 2021.11 My lovelace configuration method (GUI or yaml): yaml What I am doing: adding a section to card-mod-theme for changing state color on certain domains What I expected to happen: no warning in the logs What happened instead: Warnings in the homeassistant.log
Happening on each view change
Minimal steps to reproduce:
Error messages from the browser console:
Not sure if this is related, but there is:
without very much to go on unfortunately
fwiw: the card-mod seems to work as intended ;-)
By putting an X in the boxes ([]) below, I indicate that I:
[X] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
[X] Have made sure I am using the latest version of the plugin.
[X] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
[X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.