Skip to content

Commit

Permalink
[ 1.0.40 ] * Corrected a bug in the underlying bosesoundtouchapi th…
Browse files Browse the repository at this point in the history
…at was returning an incorrect image url for currently playing media. This incorrect value was being used by the `media_player.media_image_url` value, which caused an incorrect image to be displayed for currently playing media in the media player UI.

  * Updated underlying `bosesoundtouchapi` package requirement to version 1.0.58.
  • Loading branch information
thlucas1 committed Apr 15, 2024
1 parent 790097a commit 5a133af
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Change are listed in reverse chronological order (newest to oldest).

<span class="changelog">

MediaPlayerState
###### [ 1.0.40 ] - 2024/04/15

* Corrected a bug in the underlying `bosesoundtouchapi` that was returning an incorrect image url for currently playing media. This incorrect value was being used by the `media_player.media_image_url` value, which caused an incorrect image to be displayed for currently playing media in the media player UI.
* Updated underlying `bosesoundtouchapi` package requirement to version 1.0.58.

###### [ 1.0.39 ] - 2024/04/05

Expand Down
14 changes: 14 additions & 0 deletions custom_components/soundtouchplus/browse_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class BrowsableMedia(StrEnum):
PANDORA_STATIONS = "pandora_stations"
SOUNDTOUCH_PRESETS = "soundtouch_presets"
SOUNDTOUCH_RECENTLY_PLAYED = "soundtouch_recently_played"
# FAVORITES = "favorites"
# spotify library types should all start with "spotify_".
SPOTIFY_LIBRARY_INDEX = "spotify_library_index"
SPOTIFY_CATEGORY_PLAYLISTS = "spotify_category_playlists"
Expand Down Expand Up @@ -127,6 +128,14 @@ class BrowsableMedia(StrEnum):
"parent": MediaClass.DIRECTORY,
"children": MediaClass.TRACK,
},
# BrowsableMedia.FAVORITES.value: {
# "title": "Favorites",
# "title_node": "SoundTouchPlus Favorites",
# "image": f"/local/images/{DOMAIN}_medialib_favorites.png",
# "parent": MediaClass.DIRECTORY,
# "children": MediaClass.TRACK,
# "is_index_item": False,
# },
BrowsableMedia.SPOTIFY_LIBRARY_INDEX.value: {
"title": "Spotify",
"title_node": "SoundTouchPlus Spotify Media Library",
Expand Down Expand Up @@ -596,6 +605,11 @@ def browse_media_node(hass:HomeAssistant,
media:RecentList = data.client.GetRecentList(True, resolveSourceTitles=True)
items = media.Recents

# elif media_content_type == BrowsableMedia.FAVORITES:
# _logsi.LogVerbose("'%s': querying client device for SoundTouch presets" % playerName)
# media:PresetList = data.client.GetPresetList(refresh=True, resolveSourceTitles=True)
# items = media.Presets

elif media_content_type == BrowsableMedia.PANDORA_STATIONS:
_logsi.LogVerbose("'%s': querying client device for Pandora stations" % playerName)
sourceItems:SourceList = data.client.GetSourceList(refresh=False)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/soundtouchplus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"issue_tracker": "https://github.com/thlucas1/homeassistantcomponent_soundtouchplus/issues",
"loggers": [ "bosesoundtouchapi" ],
"requirements": [
"bosesoundtouchapi==1.0.57",
"bosesoundtouchapi==1.0.58",
"smartinspectPython>=3.0.33",
"spotifywebapiPython==1.0.42"
],
"version": "1.0.39",
"version": "1.0.40",
"zeroconf": [ "_soundtouch._tcp.local." ]
}
1 change: 1 addition & 0 deletions custom_components/soundtouchplus/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -2379,6 +2379,7 @@ async def async_browse_media(self, media_content_type:MediaType|str|None=None, m
)

elif media_content_type == 'favorites':

# ignore Sonos-Card "favorites" node queries.
_logsi.LogVerbose("'%s': ignoring Sonos-Card favorites query (no SoundTouch equivalent)" % self.name)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ colorlog==6.7.0
homeassistant==2023.8.0
ruff==0.1.3
smartinspectPython>=3.0.33
bosesoundtouchapi==1.0.56
bosesoundtouchapi==1.0.58
spotifywebapiPython==1.0.42

0 comments on commit 5a133af

Please sign in to comment.