diff --git a/current-functions.txt b/current-functions.txt index 4f7a13a..3d1079b 100644 --- a/current-functions.txt +++ b/current-functions.txt @@ -94,14 +94,17 @@ target: entity_id: media_player.spotify_bhetherman data: - source: "{{ room | replace('Living Room', 'a334c8ba989367b52303eaa9dbc424cdd83012b5') | replace('Bedroom', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') }}" + source: "{{ room | replace('Living Room', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') | replace('Bedroom', 'a334c8ba989367b52303eaa9dbc424cdd83012b5') }}" - repeat: while: - condition: template value_template: >- - {{ repeat.index <= 8 and - (state_attr('media_player.spotify_bhetherman', 'supported_features') | int(0) - | bitwise_and(512)) != 512 }} + {{ repeat.index <= 8 and ( + state_attr('media_player.spotify_bhetherman', 'source') != + (room | replace('Living Room', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') | replace('Bedroom', 'a334c8ba989367b52303eaa9dbc424cdd83012b5')) + or (state_attr('media_player.spotify_bhetherman', 'supported_features') | int(0) + | bitwise_and(512)) != 512 + ) }} sequence: - delay: "00:00:01" - service: media_player.play_media @@ -145,14 +148,17 @@ target: entity_id: media_player.spotify_bhetherman data: - source: "{{ room | replace('Living Room', 'a334c8ba989367b52303eaa9dbc424cdd83012b5') | replace('Bedroom', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') }}" + source: "{{ room | replace('Living Room', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') | replace('Bedroom', 'a334c8ba989367b52303eaa9dbc424cdd83012b5') }}" - repeat: while: - condition: template value_template: >- - {{ repeat.index <= 8 and - (state_attr('media_player.spotify_bhetherman', 'supported_features') | int(0) - | bitwise_and(512)) != 512 }} + {{ repeat.index <= 8 and ( + state_attr('media_player.spotify_bhetherman', 'source') != + (room | replace('Living Room', 'd0166d6f83796b0f9059b0adf0f6cb0d81fa6376') | replace('Bedroom', 'a334c8ba989367b52303eaa9dbc424cdd83012b5')) + or (state_attr('media_player.spotify_bhetherman', 'supported_features') | int(0) + | bitwise_and(512)) != 512 + ) }} sequence: - delay: "00:00:01" - service: media_player.play_media diff --git a/current-prompt.txt b/current-prompt.txt index 729b528..b78ddd6 100644 --- a/current-prompt.txt +++ b/current-prompt.txt @@ -64,4 +64,4 @@ entity_id,name,state,aliases {% endfor -%} ``` -Available Spotify Connect rooms (valid values for the "room" parameter): {{ state_attr('media_player.spotify_bhetherman', 'source_list') | join(', ') | replace('a334c8ba989367b52303eaa9dbc424cdd83012b5', 'Living Room') | replace('d0166d6f83796b0f9059b0adf0f6cb0d81fa6376', 'Bedroom') }} \ No newline at end of file +Available Spotify Connect rooms (valid values for the "room" parameter): {{ state_attr('media_player.spotify_bhetherman', 'source_list') | join(', ') | replace('d0166d6f83796b0f9059b0adf0f6cb0d81fa6376', 'Living Room') | replace('a334c8ba989367b52303eaa9dbc424cdd83012b5', 'Bedroom') }} \ No newline at end of file