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

Errors in log since 2024.02 #89

Closed
airwolf79 opened this issue Feb 11, 2024 · 2 comments
Closed

Errors in log since 2024.02 #89

airwolf79 opened this issue Feb 11, 2024 · 2 comments
Assignees

Comments

@airwolf79
Copy link

Hi there,

Since the recent update of HA to 2024.02 (or since the recent bugfix in lcars theme, I am not quite sure about the specific timing) i am getting my log file spammed with errormessages.

The specific message is:
2024-02-11 07:38:50.030 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'entity' when rendering '/* Header classes and fixes for specific card types */

Followed by the complete lcars template code.
I think the problematic part is:

ha-card {
padding: 0px !important;
border-top-right-radius: var(--ha-card-border-radius) !important;
border-top-left-radius: var(--ha-card-border-radius) !important;
--mdc-theme-primary: var(--lcars-ui-secondary) !important;
{% if has_value(config.entity | string) %}
{% if is_state(config.entity | string, 'off') %}
--state-color: var(--lcars-dark-gray);
{% else %}
--state-color: var(--lcars-gray);
{% endif %}
{% else %}
--state-color: var(--lcars-dark-gray);
{% endif %}
}

I have removed the if-then-else part from there and the problems have gone away

I am not sure if it is a problem on my specific instance, a problem on HA side or something that can be corrected on the template side?

@kwbeck
Copy link

kwbeck commented Feb 12, 2024

Same issue here, and removing the referenced lines also stopped the error messages for me.

@th3jesta
Copy link
Owner

I didn't see these errors, but it might be because I have a different logging level. Either way, the if/else block wasn't doing what I wanted it to anyway, and I prefer not changing the state-color altogether and let the icons change per their normal behavior. This is resolved in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants