Skip to content

Commit 8e4de95

Browse files
committed
feat: move to nested structure for configurations
1 parent 1bdb22a commit 8e4de95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2349
-1238
lines changed

BREAKING_CHANGES.md

Lines changed: 168 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,21 @@
22

33
## Release v10
44

5-
This release includes a major refactoring of configuration property names to improve consistency and organization. All section-specific configuration options now use a consistent naming convention with section prefixes.
5+
This release includes a major refactoring to use **nested YAML configuration**. Section-specific options are now organized under their respective section keys for a cleaner, more intuitive configuration structure.
66

77
### ⚠️ Configuration Migration Required
88

9-
If you have existing card configurations, you will need to update the following property names:
9+
All section-specific configuration options now live under nested section keys (`player`, `favorites`, `groups`, `grouping`, `volumes`, `queue`).
1010

1111
#### Media Browser → Favorites (Section Rename)
1212

1313
The "Media Browser" section has been renamed to "Favorites" throughout the codebase and configuration.
1414

15-
#### Player Section
16-
17-
| Old Name | New Name |
18-
|----------|----------|
19-
| `hidePlayerArtwork` | `playerHideArtwork` |
20-
| `artworkMinHeight` | `playerArtworkMinHeight` |
21-
| `artworkAsBackground` | `playerArtworkAsBackground` |
22-
| `artworkAsBackgroundBlur` | `playerArtworkAsBackgroundBlur` |
23-
| `artworkHostname` | `playerArtworkHostname` |
24-
| `fallbackArtwork` | `playerFallbackArtwork` |
25-
| `mediaArtworkOverrides` | `playerMediaArtworkOverrides` |
26-
| `labelWhenNoMediaIsSelected` | `playerLabelWhenNoMediaIsSelected` |
27-
| `showVolumeUpAndDownButtons` | `playerShowVolumeUpAndDownButtons` |
28-
| `showFastForwardAndRewindButtons` | `playerShowFastForwardAndRewindButtons` |
29-
| `fastForwardAndRewindStepSizeSeconds` | `playerFastForwardAndRewindStepSizeSeconds` |
30-
| `showAudioInputFormat` | `playerShowAudioInputFormat` |
31-
| `showSourceInPlayer` | `playerShowSource` |
32-
| `showChannelInPlayer` | `playerShowChannel` |
33-
| `showBrowseMediaInPlayerSection` | `playerShowBrowseMediaButton` |
34-
| `stopInsteadOfPause` | `playerStopInsteadOfPause` |
35-
36-
#### Favorites Section
37-
38-
| Old Name | New Name |
39-
|----------|----------|
40-
| `customFavorites` | `favoritesCustomFavorites` |
41-
| `customFavoriteThumbnails` | `favoritesCustomThumbnails` |
42-
| `customFavoriteThumbnailsIfMissing` | `favoritesCustomThumbnailsIfMissing` |
43-
| `topFavorites` | `favoritesTopItems` |
44-
| `numberOfFavoritesToShow` | `favoritesNumberToShow` |
45-
| `sortFavoritesByType` | `favoritesSortByType` |
46-
| `replaceHttpWithHttpsForThumbnails` | `favoritesReplaceHttpWithHttpsForThumbnails` |
47-
48-
#### Groups Section
49-
50-
| Old Name | New Name |
51-
|----------|----------|
52-
| `compactGroups` | `groupsCompact` |
53-
| `groupButtonWidth` | `groupsButtonWidth` |
54-
55-
#### Grouping Section
56-
57-
| Old Name | New Name |
58-
|----------|----------|
59-
| `compactGrouping` | `groupingCompact` |
60-
| `skipApplyButtonWhenGrouping` | `groupingSkipApplyButton` |
61-
| `dontSwitchPlayerWhenGrouping` | `groupingDontSwitchPlayer` |
62-
63-
#### Volumes Section
64-
65-
| Old Name | New Name |
66-
|----------|----------|
67-
| `labelForTheAllVolumesSlider` | `volumesLabelForAllSlider` |
68-
69-
### New Features
70-
71-
- **Tabbed Advanced Editor**: The advanced editor now organizes configuration options into tabs by section (Common, Player, Favorites, Groups, Grouping, Volumes, Queue) for easier navigation.
72-
- **Consistent Naming Convention**: All section-specific options now follow a consistent `{section}{PropertyName}` pattern, making it clearer which section each option affects.
73-
74-
### Migration Example
75-
76-
**Before:**
77-
```yaml
78-
type: custom:sonos-card
79-
artworkAsBackground: true
80-
artworkMinHeight: 10
81-
hidePlayerArtwork: false
82-
compactGroups: true
83-
topFavorites:
84-
- My Playlist
85-
- Radio Station
86-
```
15+
### New Nested Structure
16+
17+
Instead of flat configuration with prefixes, options are now organized under their section:
8718

88-
**After:**
19+
**Before (v9):**
8920
```yaml
9021
type: custom:sonos-card
9122
playerArtworkAsBackground: true
@@ -96,3 +27,165 @@ favoritesTopItems:
9627
- My Playlist
9728
- Radio Station
9829
```
30+
31+
**After (v10):**
32+
```yaml
33+
type: custom:sonos-card
34+
player:
35+
artworkAsBackground: true
36+
artworkMinHeight: 10
37+
hideArtwork: false
38+
groups:
39+
compact: true
40+
favorites:
41+
topItems:
42+
- My Playlist
43+
- Radio Station
44+
```
45+
46+
### Section Configuration Reference
47+
48+
#### Player Section (`player:`)
49+
50+
| Property | Description |
51+
|----------|-------------|
52+
| `artworkAsBackground` | Use artwork as background |
53+
| `artworkAsBackgroundBlur` | Blur amount for artwork background |
54+
| `artworkHostname` | Override hostname for artwork URLs |
55+
| `artworkMinHeight` | Minimum height of artwork (rem) |
56+
| `backgroundOverlayColor` | Background overlay color (e.g., `rgba(0,0,0,0.3)`) |
57+
| `controlsAndHeaderBackgroundOpacity` | Opacity for controls and header background |
58+
| `controlsColor` | Color for control icons |
59+
| `controlsLargeIcons` | Use large control icons |
60+
| `controlsMargin` | Margin around controls |
61+
| `fallbackArtwork` | Fallback artwork URL |
62+
| `fastForwardAndRewindStepSizeSeconds` | Step size for fast forward/rewind |
63+
| `headerEntityFontSize` | Font size for entity name |
64+
| `headerSongFontSize` | Font size for song title |
65+
| `hideArtistAlbum` | Hide artist and album |
66+
| `hideArtwork` | Hide artwork |
67+
| `hideControls` | Hide all controls |
68+
| `hideControlNextTrackButton` | Hide next track button |
69+
| `hideControlPowerButton` | Hide power button |
70+
| `hideControlPrevTrackButton` | Hide previous track button |
71+
| `hideControlRepeatButton` | Hide repeat button |
72+
| `hideControlShuffleButton` | Hide shuffle button |
73+
| `hideEntityName` | Hide entity name |
74+
| `hideHeader` | Hide player header |
75+
| `hidePlaylist` | Hide playlist |
76+
| `hideVolume` | Hide volume control |
77+
| `hideVolumeMuteButton` | Hide mute button |
78+
| `hideVolumePercentage` | Hide volume percentage |
79+
| `labelWhenNoMediaIsSelected` | Label when no media is playing |
80+
| `mediaArtworkOverrides` | Array of artwork override rules |
81+
| `showAudioInputFormat` | Show audio input format |
82+
| `showBrowseMediaButton` | Show browse media button |
83+
| `showChannel` | Show channel |
84+
| `showFastForwardAndRewindButtons` | Show fast forward/rewind buttons |
85+
| `showSource` | Show source |
86+
| `showVolumeUpAndDownButtons` | Show volume up/down buttons |
87+
| `stopInsteadOfPause` | Stop instead of pause |
88+
| `volumeEntityId` | Entity ID for volume control |
89+
| `volumeMuteButtonSize` | Size of mute button (rem) |
90+
| `volumeSliderHeight` | Height of volume slider (rem) |
91+
92+
#### Favorites Section (`favorites:`)
93+
94+
| Property | Description |
95+
|----------|-------------|
96+
| `customFavorites` | Custom favorites configuration |
97+
| `customThumbnails` | Custom thumbnail URLs |
98+
| `customThumbnailsIfMissing` | Custom thumbnails when missing |
99+
| `hideBrowseMediaButton` | Hide browse media button |
100+
| `hideHeader` | Hide favorites header |
101+
| `hideTitleForThumbnailIcons` | Hide titles for thumbnail icons |
102+
| `iconBorder` | Border for icons (e.g., `1px solid white`) |
103+
| `iconPadding` | Padding around icons (rem) |
104+
| `iconTitleBackgroundColor` | Background color for icon titles |
105+
| `iconTitleColor` | Color for icon titles |
106+
| `itemsPerRow` | Number of items per row |
107+
| `numberToShow` | Number of favorites to show |
108+
| `replaceHttpWithHttpsForThumbnails` | Replace HTTP with HTTPS |
109+
| `sortByType` | Sort favorites by type |
110+
| `title` | Custom title for section |
111+
| `exclude` | Array of favorites to exclude (matched against title and media_content_id) |
112+
| `topItems` | Array of favorites to show first |
113+
114+
#### Groups Section (`groups:`)
115+
116+
| Property | Description |
117+
|----------|-------------|
118+
| `buttonWidth` | Width of group buttons (rem) |
119+
| `compact` | Compact mode |
120+
| `hideCurrentTrack` | Hide current track info |
121+
| `itemMargin` | Margin around items |
122+
| `title` | Custom title for section |
123+
124+
#### Grouping Section (`grouping:`)
125+
126+
| Property | Description |
127+
|----------|-------------|
128+
| `buttonColor` | Button background color |
129+
| `buttonFontSize` | Button font size (rem) |
130+
| `buttonIcons` | Custom button icons |
131+
| `compact` | Compact mode |
132+
| `disableMainSpeakers` | Disable main speakers |
133+
| `dontSortMembersOnTop` | Don't sort members on top |
134+
| `dontSwitchPlayer` | Don't switch player when grouping |
135+
| `hideUngroupAllButtons` | Hide ungroup all buttons |
136+
| `skipApplyButton` | Skip apply button |
137+
| `title` | Custom title for section |
138+
139+
#### Volumes Section (`volumes:`)
140+
141+
| Property | Description |
142+
|----------|-------------|
143+
| `hideCogwheel` | Hide cogwheel button |
144+
| `labelForAllSlider` | Label for "all" volume slider |
145+
| `title` | Custom title for section |
146+
147+
#### Queue Section (`queue:`) - Sonos Card only
148+
149+
| Property | Description |
150+
|----------|-------------|
151+
| `itemBackgroundColor` | Background color for queue items |
152+
| `itemTextColor` | Text color for queue items |
153+
| `title` | Custom title for section |
154+
155+
### Cross-Section Options (Root Level)
156+
157+
These options remain at the root level as they affect multiple sections:
158+
159+
| Property | Description |
160+
|----------|-------------|
161+
| `adjustVolumeRelativeToMainPlayer` | Adjust volume relative to main player |
162+
| `allowPlayerVolumeEntityOutsideOfGroup` | Allow volume entity outside of group |
163+
| `baseFontSize` | Base font size (rem) |
164+
| `changeVolumeOnSlide` | Change volume while sliding |
165+
| `doNotRememberSelectedPlayer` | Don't remember selected player |
166+
| `dynamicVolumeSlider` | Enable dynamic volume slider |
167+
| `dynamicVolumeSliderMax` | Maximum for dynamic slider |
168+
| `dynamicVolumeSliderThreshold` | Threshold for dynamic slider |
169+
| `entities` | Array of entity IDs |
170+
| `entitiesToIgnoreVolumeLevelFor` | Entities to ignore volume level for |
171+
| `entityId` | Force selected entity |
172+
| `entityNameRegexToReplace` | Regex for entity name replacement |
173+
| `entityNameReplacement` | Replacement for entity name |
174+
| `entityPlatform` | Entity platform filter |
175+
| `excludeItemsInEntitiesList` | Exclude items in entities list |
176+
| `footerHeight` | Footer height |
177+
| `heightPercentage` | Height percentage |
178+
| `inverseGroupMuteState` | Inverse group mute state |
179+
| `mediaTitleRegexToReplace` | Regex for media title replacement |
180+
| `mediaTitleReplacement` | Replacement for media title |
181+
| `minWidth` | Minimum width (rem) |
182+
| `predefinedGroups` | Array of predefined groups |
183+
| `sectionButtonIconSize` | Section button icon size |
184+
| `sectionButtonIcons` | Custom section button icons |
185+
| `sections` | Array of sections to show |
186+
| `showNonSonosPlayers` | Show non-Sonos players |
187+
| `startSection` | Section to show on start |
188+
| `storePlayerInSessionStorage` | Store player in session storage |
189+
| `title` | Card title |
190+
| `volumeStepSize` | Volume step size |
191+
| `widthPercentage` | Width percentage |

0 commit comments

Comments
 (0)