1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Media Player: added play_media action (#3579)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Sergey Dudanov
2022-06-20 04:17:20 +04:00
committed by GitHub
parent 8110e591d0
commit b0c0258e70
3 changed files with 54 additions and 2 deletions

View File

@@ -615,12 +615,18 @@ media_player:
mute_pin: GPIO14
on_state:
- media_player.play:
- media_player.play_media: http://localhost/media.mp3
- media_player.play_media: !lambda 'return "http://localhost/media.mp3";'
on_idle:
- media_player.pause:
on_play:
- media_player.stop:
on_pause:
- media_player.toggle:
- wait_until:
media_player.is_idle:
- wait_until:
media_player.is_playing:
- media_player.volume_up:
- media_player.volume_down:
- media_player.volume_set: 50%