JLindvig

Untitled

Jan 26th, 2022 (edited)
216
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 %}
RAW Paste Data Copied