punxaphil / custom-sonos-card

Home Assistant custom lovelace sonos card
186 stars 21 forks source link

Feature Request: Manual sorting/filtering of favorites list #119

Closed rbreneman closed 1 year ago

rbreneman commented 1 year ago

Sonos defaults to sorting the favorites list A-Z and that is how the media browser card displays. Would be awesome if there was a way to manually sort (without a drag/drop option in Sonos app, this would likely be manually entering names into yaml, not ideal but better than nothing) and then control which favorites display and then use multiple media browser cards with custom titles. For example, one card shows radio stations, another card shows my wfie’s favorites, etc…

Summary, 2 asks:

punxaphil commented 1 year ago

Thanks, I'll see what I can about this!

maddox commented 1 year ago

Being able to just enter a short list of favorites in a list, and then having them pushed to the top, while all the other favorites flow in below them, would be awesome.

This would give us a way to push the most used to the top, without having to prefix them with _ and other characters 🤣

punxaphil commented 1 year ago

@maddox @rbreneman Please try this beta, and let me know how it works for you: https://github.com/johanfrick/custom-sonos-card/releases/tag/v6.7-beta1

Example:

image

In the visual editor:

image

In yaml:

type: custom:sonos-card
topFavorites: # Show these favorites at the top of the list
  - Legendary
  - Country Rocks
  - Kacey Musgraves Radio

README: https://github.com/johanfrick/custom-sonos-card/blob/topFavorites/README.md#configuration-in-yaml

maddox commented 1 year ago

WOO! Works great. I know this is a super niche and pedantic request, but it really helps the usability of the playlist picker. Thanks!

punxaphil commented 1 year ago

Non-beta released: https://github.com/johanfrick/custom-sonos-card/releases/tag/v6.7

maddox commented 1 year ago

i'm seeing weird behavior now where it only lists my playlists from Sonos favorites, and not the stations. I can see the stations in the media browser though.

punxaphil commented 1 year ago

I still see stations. Please share your config.

maddox commented 1 year ago
entityId: media_player.sonos_family_room
sections:
  - player
  - volumes
  - groups
  - grouping
  - media browser
topFavorites:
  - Chill Station
  - Van Morrison
mediaBrowserShowTitleForThumbnailIcons: false
mediaBrowserItemsPerRow: 1
view_layout:
  grid-area: c2
maddox commented 1 year ago

This is very odd. I use a custom domain for my hass. When i use that, i don't see stations. When I use the regular IP and Port, i see stations.

This is also causing the topFavorites to not actually work.

I'm also seeing this error in the console:

Failed to load resource: the server responded with a status of 404 (Not Found) http://IP:8123/hacsfiles/custom-sonos-card/custom-sonos-card.js.map

maddox commented 1 year ago

I'm also not able to push items to the top that have quotes in them:

Ollie's List, Jon's Rotation, Jon Maddox's Station

Sorry to catch all these AFFFFFFTER the release!

punxaphil commented 1 year ago

No worries, nothing is ever bug free right? 😄 Thanks a lot for testing it so quickly, this made me find another bug also regarding special characters. Bug fix release is out: https://github.com/johanfrick/custom-sonos-card/releases/tag/v6.7.1 Please test 🙏

maddox commented 1 year ago

Looks great! 🎉

rbreneman commented 1 year ago

This is great! Would it be possible to have another field that could accept a comma separated list of favorites and a boolean option to show/hide the favorites in that list? Use case would be of my 30+ favorites I only want to make 4 of them available in a specific card on a specific dashboard page (kids room, kitchen, etc...)