-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Markdown card templates using stricter rendering than developer-tools #20862
Comments
Thanks for verifying, but it only fails for entities where the device class is missing. |
Yes I see what you mean. It seems markdown card subscribes its template with an additional argument Related: #17824 |
So it seems that Perhaps that should be reported as a core bug, that report_errors should be able to report everything that strict mode would catch. I assume that was its intention but I don't know. |
@karwosts |
My first experiments with selectattr / rejectattr were on 2021 - and on that time I learned that I must check for an attribute existence before using selectattr/rejectattr. |
I agree it is not very robust, But How to do that in filter expressions?! When I lookup a value with state_attr(), I have to check, but in a filter I want to include/exclude entities that match. Update: @ildar170975 thanks for your hint. This combo of filters works in the markdown as well:
It complicates my full template, as I also want the entity's that don't have a device_class attribute (so need to merge two lists). But it's a workaround. Still hope the issue gets solved though. |
Checklist
Describe the issue you are experiencing
I have a simple template that filters on the 'device_class' attribute of an entity. That template works fine in e.g dev tools or as an template sensor, but fails in the markdown card for entities that don't have a 'device_class'.
Describe the behavior you expected
Template works the same as in Dev Tools or in the template integration. I also verified a number of other cards that support templates, and there it works fine. So it seems a markdown card specific issue.
Steps to reproduce the issue
What version of Home Assistant Core has the issue?
Core 2024.5.4
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Chrome, Safari
Which operating system are you using to run this browser?
Win11 aan iOS 17
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: