[Question] How to display list of dicts?
csoltenborn opened this issue · comments
I'm trying to display information about outdated HACS components. For this, I have defined some sensors (basically following this approach) which provide the outdated repositories. Thus, with Development Tools/Template, the statement {{ (state_attr('binary_sensor.hacs_update_issues', 'status')).repositories }}
results in the following output:
[{'name': 'FL550/dwd_weather', 'display_name': 'Deutscher Wetterdienst', 'installed_version': 'v1.2.1', 'available_version': 'v1.2.2'}, {'name': 'briis/weatherbit', 'display_name': 'Weatherbit Weather Forecast for Home Assistant', 'installed_version': 'v0.34', 'available_version': 'v0.34.1'}]
I'm then trying to use the following code for the UI part:
type: 'custom:auto-entities'
card:
type: 'custom:flex-table-card'
title: Pending HACS updates
columns:
- name: Component
data: display_name
- name: Current version
data: installed_version
- name: Latest version
data: available_version
sort:
method: attribute
attribute: display_name
filter:
template: >
{{ (state_attr('binary_sensor.hacs_update_issues', 'status')).repositories }}
However, no rows are shown. The same is true for the following template I tried.
{%- for repository in (state_attr('binary_sensor.hacs_update_issues', 'status')).repositories -%}
{{ repository}},
{%- endfor -%}
Is what I'm doing possible at all with flex-table-card? Thanks in advance...
did you resolve it ?
Well, i'm interested too.
this is currently not really possible, best would be something like that:
type: 'custom:flex-table-card'
title: blub blub
columns:
- name: descent-into-object
data: repositories.foo
already tried a naive approach, but this looks like this might be more challenging than expected...