Skip to content

Commit

Permalink
Update validate-with-hassfest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bastgau committed Sep 13, 2024
1 parent f22352f commit 752b0c3
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/validate-with-hassfest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
pull_request:

jobs:
validate:
validate-hassfest:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "home-assistant/actions/hassfest@master"
- uses: "home-assistant/actions/hassfest@master"
106 changes: 92 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# Custom universal media player for Home Assistant

![HACS validation](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-for-hacs.yml/badge.svg)
![HASSFEST validation](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-with-hassfest.yml/badge.svg)

[![Maintenair : bastgau](https://img.shields.io/badge/maintener-bastgau-orange?logo=github&logoColor=%23959da5&labelColor=%232d333a)](https://github.com/bastgau)
[![Made with Python](https://img.shields.io/badge/Made_with-Python-blue?style=flat&logo=python&logoColor=%23959da5&labelColor=%232d333a)](https://www.python.org/)
[![Made for Home Assistant](https://img.shields.io/badge/Made_for-Homeassistant-blue?style=flat&logo=homeassistant&logoColor=%23959da5&labelColor=%232d333a)](https://www.home-assistant.io/)
[![GitHub Release](https://img.shields.io/github/v/release/bastgau/ha-custom-universal-media-player?logo=github&logoColor=%23959da5&labelColor=%232d333a&color=%230e80c0)](https://github.com/bastgau/ha-custom-universal-media-player/releases)
[![HACS validation](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-for-hacs.yml/badge.svg)](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-for-hacs.yml)
[![HASSFEST validation](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-with-hassfest.yml/badge.svg)](https://github.com/bastgau/ha-custom-universal-media-player/actions/workflows/validate-with-hassfest.yml)

<p align="center" width="100%">
<img src="https://brands.home-assistant.io/_/custom_universal_media_player/logo.png">
</p>

Original component : [Universal media player](https://www.home-assistant.io/integrations/universal/)

Expand All @@ -13,24 +22,93 @@ In the modified version (this version), these attributes are now accessible by t

List of attributes added and now accessible:

- app_id
- app_name
- media_album_artist
- media_album_name
- media_artist
- media_channel
- media_content_type
- media_duration
- media_image_url
- media_title
- media_artist
- media_album_name
- media_album_artist
- media_track
- media_series_title
- media_season
- media_episode
- media_channel
- media_image_url
- media_playlist
- app_id
- app_name
- media_position
- media_position_updated_at
- media_season
- media_series_title
- media_title
- media_track

The configuration has been unchanged. Please check the notice of the [universal media player](https://www.home-assistant.io/integrations/universal/#usage-examples).

## Example

The parent media player is a [Music Assistant](https://github.com/music-assistant/hass-music-assistant) media player.
The child media player is a [Mini Google Home](https://www.home-assistant.io/integrations/cast).

1. If the _Music Assistant media player_ is playing, the _custom universal media player_ will reflect its attributes except the attributes listed in attributes node.
2. If the _Music Assistant media player_ is idle and _Google Home_ is playing, the _custom universal media player_ will change to reflect the active player attributes.

In this example, most actions are overridden by the child media player (_Google Home_). Only the specific _Music Assistant media player_ actions are *not* overridden.

The configuration has been unchanged. Please check the notice of the universal media player.
```yaml
- platform: custom_universal_media_player
name: "Google Home Bureau"
unique_id: custom_media_player_bureau
device_class: speaker
children:
- media_player.mass_bureau
- media_player.google_home_bureau
commands:
media_play:
action: media_player.media_play
target:
entity_id: media_player.mass_bureau
media_play_pause:
action: media_player.media_play_pause
target:
entity_id: media_player.google_home_bureau
turn_on:
action: media_player.turn_on
target:
entity_id: media_player.google_home_bureau
turn_off:
action: media_player.turn_off
target:
entity_id: media_player.google_home_bureau
volume_up:
action: media_player.volume_up
target:
entity_id: media_player.google_home_bureau
volume_down:
action: media_player.volume_down
target:
entity_id: media_player.google_home_bureau
media_pause:
action: media_player.media_pause
target:
entity_id: media_player.google_home_bureau
media_previous_track:
action: media_player.media_previous_track
target:
entity_id: media_player.mass_bureau
media_next_track:
action: media_player.media_next_track
target:
entity_id: media_player.mass_bureau
attributes:
entity_picture: media_player.google_home_bureau|entity_picture
is_volume_muted: media_player.google_home_bureau|is_volume_muted
media_album_artist: media_player.google_home_bureau|media_album_artist
media_album_name: media_player.google_home_bureau|media_album_name
media_artist: media_player.google_home_bureau|media_artist
media_image_url: media_player.google_home_bureau|entity_picture
media_title: media_player.google_home_bureau|media_title
source_list: media_player.google_home_bureau|source_list
source: media_player.google_home_bureau|source
state: media_player.google_home_bureau
volume_level: media_player.google_home_bureau|volume_level
```
Enjoy!
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://bastgau.github.com/bastgau/ha-custom-universal-media-player/issues",
"loggers": ["custom_universal_media_player"],
"requirements": [],
"version": "v1.1.0"
"version": "v1.2.0"
}
7 changes: 4 additions & 3 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "Custom universal media player",
"hacs": "2.0.0",
"homeassistant": "2024.9.0",
"render_readme": true,
"country": "FR"
}
"country": "FR",
"render_readme": true
}

0 comments on commit 752b0c3

Please sign in to comment.