#Toggle media player shuffle
1 messages · Page 1 of 1 (latest)
also I wanted to test and came across this where I can't actually select the media player in the ui
you are using a media picker there, not an entity picker. But yeah, I've noticed myself that the media picker seems broken. There is already an open issue on it if I'm not mistaken.
ok nice, but I still don't know how I could invert the result from state_attr
The attribute is a boolean right? Just use {{ not state_attr(media_player. entity_id, 'shuffle') }}
oh ok
do you by chance know if I can select to insert a yaml declaration here directly through the pop up or do I have to click on the 3 dots and 'Edit in YAML'?
you'd need to edit in YAML
oh ok, so I'm now making a new one for cycling the repeat options but I don't know how to do a multi line template like this
please post the full yaml and format it as code, this screenshot cuts parts off, and if I'd want to give suggestions I'd have to type it all over again
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
action: media_player.repeat_set
metadata: {}
target:
entity_id: "{{ media_player }}"
data:
repeat: |
{% if state_attr(media_player, \"repeat\") == 'all' %}
one
{% elif state_attr(media_player, \"repeat\") == 'one' %}
off
{% else %}
all
{% endif %}