added music card documentation
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
# ESPHome Button+ - Music card
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
* Add the music card file to youre files and supply the `entity_id`
|
||||||
|
```
|
||||||
|
substitutions:
|
||||||
|
music_card_enity_id: 'media_player.media_keuken_2'
|
||||||
|
package:
|
||||||
|
remote_package_files:
|
||||||
|
url: https://github.com/dixi83/ESPHome_ButtonPlus
|
||||||
|
files: [<other files>,'package/cards/music.yaml']
|
||||||
|
```
|
||||||
|
* Add the music card to the main display `lambda` and give it the position you want
|
||||||
|
```
|
||||||
|
id(music_card).execute(20, 125);
|
||||||
|
```
|
||||||
|
|
||||||
|
* Add the icons buttons to the BAR's
|
||||||
|
|
||||||
|
Select one of the folowing types:
|
||||||
|
* `volume_up`
|
||||||
|
* `volume_down`
|
||||||
|
* `next`
|
||||||
|
* `prev`
|
||||||
|
* `playpause`
|
||||||
|
* `power`
|
||||||
|
|
||||||
|
```
|
||||||
|
id(music_card_bar).execute('volume_up')
|
||||||
|
```
|
||||||
|
|
||||||
|
* add actions to the buttons
|
||||||
|
Select the a matching action for the button:
|
||||||
|
* `music_card_vol_up`
|
||||||
|
* `music_card_vol_down`
|
||||||
|
* `music_card_next`
|
||||||
|
* `music_card_prev`
|
||||||
|
* `music_card_playpause`
|
||||||
|
* `music_card_power`
|
||||||
|
|
||||||
|
```
|
||||||
|
id(music_card_vol_up).execute()
|
||||||
|
```
|
||||||
@@ -163,4 +163,39 @@ script:
|
|||||||
id(main_display).image(80, 2, id(icon_music_on), ImageAlign::TOP_CENTER, id(music_card_icon_bar_color));
|
id(main_display).image(80, 2, id(icon_music_on), ImageAlign::TOP_CENTER, id(music_card_icon_bar_color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- id: music_card_vol_up
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.volume_up
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
- id: music_card_vol_dowen
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.volume_down
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
- id: music_card_next
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.media_next_track
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
- id: music_card_prev
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.media_previous_track
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
- id: music_card_playpause
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.media_play_pause
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
- id: music_card_power
|
||||||
|
then:
|
||||||
|
- homeassistant.action:
|
||||||
|
action: media_player.toggle
|
||||||
|
data:
|
||||||
|
entity_id: ${music_card_enity_id}
|
||||||
|
|||||||
Reference in New Issue
Block a user