JLindvig

Untitled

Jan 26th, 2022 (edited)
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.42 KB | None | 0 0
  1. {% set connected_devices = state_attr('sensor.redmi_9t_bluetooth_connection', 'connected_paired_devices')[1:-1].split(',') %}
  2. {% set paired_devices = state_attr('sensor.redmi_9t_bluetooth_connection', 'paired_devices')[1:-1].split(',') %}
  3. {% for device in connected_devices -%}
  4.   {% if device in paired_devices %}
  5.     {{ device }} er tilsluttet
  6.   {% elif loop.last %}
  7.     Intet tilsluttet.
  8.   {%- endif %}
  9. {%- endfor %}
Add Comment
Please, Sign In to add comment