From 01c4b604c0dad4af72da1614441af3a690c22d12 Mon Sep 17 00:00:00 2001 From: hchris1 Date: Fri, 6 Oct 2023 12:13:29 +0200 Subject: [PATCH 1/3] Bump Home Assistant to 2023.10.0 --- hacs.json | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hacs.json b/hacs.json index b9b4be4..bc7dbfb 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Eversolo Integration", "filename": "eversolo.zip", "hide_default_branch": true, - "homeassistant": "2023.9.1", + "homeassistant": "2023.10.0", "render_readme": true, "zip_release": true } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 2491bfb..19e7b56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 -homeassistant==2023.9.1 +homeassistant==2023.10.0 pip>=21.0,<23.3 ruff==0.0.291 From 13813820e6bc4581d65da9f239b6789605e8de71 Mon Sep 17 00:00:00 2001 From: hchris1 Date: Fri, 6 Oct 2023 12:42:20 +0200 Subject: [PATCH 2/3] Fix media image url for AirPlay --- custom_components/eversolo/api.py | 6 +++++- custom_components/eversolo/media_player.py | 17 ++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/custom_components/eversolo/api.py b/custom_components/eversolo/api.py index 39d0160..0bbd76e 100644 --- a/custom_components/eversolo/api.py +++ b/custom_components/eversolo/api.py @@ -246,10 +246,14 @@ async def async_set_output(self, index, tag) -> any: parseJson=False, ) - def create_internal_image_url(self, song_id) -> any: + def create_image_url_by_song_id(self, song_id) -> any: """Create url to fetch album covers when using the internal player.""" return f"http://{self._host}:{self._port}/ZidooMusicControl/v2/getImage?id={song_id}&target=16" + def create_image_url_by_path(self, path) -> any: + """Create url to fetch album covers when using AirPlay by concatting the path.""" + return f"http://{self._host}:{self._port}{path}" + async def _api_wrapper( self, method: str, diff --git a/custom_components/eversolo/media_player.py b/custom_components/eversolo/media_player.py index fbb07e3..846aa42 100644 --- a/custom_components/eversolo/media_player.py +++ b/custom_components/eversolo/media_player.py @@ -226,20 +226,23 @@ def media_image_url(self): # Bluetooth or Spotify Connect if play_type == 6: - album_url = ( - music_control_state.get("everSoloPlayInfo", {}) - .get("everSoloPlayAudioInfo", {}) - .get("albumUrl", None) + album_url = music_control_state.get("everSoloPlayInfo", {}).get( + "icon", None ) - if album_url is not None: - return album_url + if album_url is None or album_url == "": + return None + + if not album_url.startswith("http"): + album_url = self.coordinator.client.create_image_url_by_path(album_url) + + return album_url # Internal Player if play_type == 5: song_id = music_control_state.get("playingMusic", {}).get("id", None) if song_id is not None: - return self.coordinator.client.create_internal_image_url(song_id) + return self.coordinator.client.create_image_url_by_song_id(song_id) return None From 852b7dffaeb79cc8ad199fe974bc78f4224fe39d Mon Sep 17 00:00:00 2001 From: hchris1 Date: Fri, 6 Oct 2023 12:45:29 +0200 Subject: [PATCH 3/3] Bump package version --- custom_components/eversolo/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/eversolo/manifest.json b/custom_components/eversolo/manifest.json index 807ba2e..81fb8bd 100644 --- a/custom_components/eversolo/manifest.json +++ b/custom_components/eversolo/manifest.json @@ -8,5 +8,5 @@ "documentation": "https://github.com/hchris1/Eversolo", "iot_class": "local_polling", "issue_tracker": "https://github.com/hchris1/Eversolo/issues", - "version": "0.2.0" + "version": "0.2.1" } \ No newline at end of file