immersive-home/lib/home_apis/hass_ws/templates/devices.j2

10 lines
423 B
Plaintext
Raw Normal View History

2023-10-30 02:21:50 +02:00
{% set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(devices = []) %}
{%- for device in devices %}
{%- set entities = device_entities(device) | list %}
{%- if entities %}
{%- set ns.devices = ns.devices + [ {device: {"name": device_attr(device, "name"), "entities": entities }} ] %}
{%- endif %}
{%- endfor %}
2023-11-05 17:36:13 +02:00
{{ ns.devices }}