mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Fix order of palettes, presets and playlists in WLED integration (#132207)
* Fix order of palettes, presets and playlists in WLED integration * fix tests: update palette items order --------- Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
5d45b84cd2
commit
35fc81b038
@ -79,9 +79,10 @@ class WLEDPresetSelect(WLEDEntity, SelectEntity):
|
|||||||
super().__init__(coordinator=coordinator)
|
super().__init__(coordinator=coordinator)
|
||||||
|
|
||||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_preset"
|
self._attr_unique_id = f"{coordinator.data.info.mac_address}_preset"
|
||||||
self._attr_options = [
|
sorted_values = sorted(
|
||||||
preset.name for preset in self.coordinator.data.presets.values()
|
coordinator.data.presets.values(), key=lambda preset: preset.name
|
||||||
]
|
)
|
||||||
|
self._attr_options = [preset.name for preset in sorted_values]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
@ -115,9 +116,10 @@ class WLEDPlaylistSelect(WLEDEntity, SelectEntity):
|
|||||||
super().__init__(coordinator=coordinator)
|
super().__init__(coordinator=coordinator)
|
||||||
|
|
||||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_playlist"
|
self._attr_unique_id = f"{coordinator.data.info.mac_address}_playlist"
|
||||||
self._attr_options = [
|
sorted_values = sorted(
|
||||||
playlist.name for playlist in self.coordinator.data.playlists.values()
|
coordinator.data.playlists.values(), key=lambda playlist: playlist.name
|
||||||
]
|
)
|
||||||
|
self._attr_options = [playlist.name for playlist in sorted_values]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
@ -159,9 +161,10 @@ class WLEDPaletteSelect(WLEDEntity, SelectEntity):
|
|||||||
self._attr_translation_placeholders = {"segment": str(segment)}
|
self._attr_translation_placeholders = {"segment": str(segment)}
|
||||||
|
|
||||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_palette_{segment}"
|
self._attr_unique_id = f"{coordinator.data.info.mac_address}_palette_{segment}"
|
||||||
self._attr_options = [
|
sorted_values = sorted(
|
||||||
palette.name for palette in self.coordinator.data.palettes.values()
|
coordinator.data.palettes.values(), key=lambda palette: palette.name
|
||||||
]
|
)
|
||||||
|
self._attr_options = [palette.name for palette in sorted_values]
|
||||||
self._segment = segment
|
self._segment = segment
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -99,77 +99,77 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'friendly_name': 'WLED RGB Light Segment 1 color palette',
|
'friendly_name': 'WLED RGB Light Segment 1 color palette',
|
||||||
'options': list([
|
'options': list([
|
||||||
'Default',
|
|
||||||
'* Random Cycle',
|
|
||||||
'* Color 1',
|
'* Color 1',
|
||||||
'* Colors 1&2',
|
|
||||||
'* Color Gradient',
|
'* Color Gradient',
|
||||||
|
'* Colors 1&2',
|
||||||
'* Colors Only',
|
'* Colors Only',
|
||||||
'Party',
|
'* Random Cycle',
|
||||||
'Cloud',
|
|
||||||
'Lava',
|
|
||||||
'Ocean',
|
|
||||||
'Forest',
|
|
||||||
'Rainbow',
|
|
||||||
'Rainbow Bands',
|
|
||||||
'Sunset',
|
|
||||||
'Rivendell',
|
|
||||||
'Breeze',
|
|
||||||
'Red & Blue',
|
|
||||||
'Yellowout',
|
|
||||||
'Analogous',
|
'Analogous',
|
||||||
'Splash',
|
|
||||||
'Pastel',
|
|
||||||
'Sunset 2',
|
|
||||||
'Beach',
|
|
||||||
'Vintage',
|
|
||||||
'Departure',
|
|
||||||
'Landscape',
|
|
||||||
'Beech',
|
|
||||||
'Sherbet',
|
|
||||||
'Hult',
|
|
||||||
'Hult 64',
|
|
||||||
'Drywet',
|
|
||||||
'Jul',
|
|
||||||
'Grintage',
|
|
||||||
'Rewhi',
|
|
||||||
'Tertiary',
|
|
||||||
'Fire',
|
|
||||||
'Icefire',
|
|
||||||
'Cyane',
|
|
||||||
'Light Pink',
|
|
||||||
'Autumn',
|
|
||||||
'Magenta',
|
|
||||||
'Magred',
|
|
||||||
'Yelmag',
|
|
||||||
'Yelblu',
|
|
||||||
'Orange & Teal',
|
|
||||||
'Tiamat',
|
|
||||||
'April Night',
|
'April Night',
|
||||||
'Orangery',
|
'Aqua Flash',
|
||||||
'C9',
|
|
||||||
'Sakura',
|
|
||||||
'Aurora',
|
|
||||||
'Atlantica',
|
'Atlantica',
|
||||||
|
'Aurora',
|
||||||
|
'Aurora 2',
|
||||||
|
'Autumn',
|
||||||
|
'Beach',
|
||||||
|
'Beech',
|
||||||
|
'Blink Red',
|
||||||
|
'Breeze',
|
||||||
|
'C9',
|
||||||
'C9 2',
|
'C9 2',
|
||||||
'C9 New',
|
'C9 New',
|
||||||
'Temperature',
|
|
||||||
'Aurora 2',
|
|
||||||
'Retro Clown',
|
|
||||||
'Candy',
|
'Candy',
|
||||||
'Toxy Reaf',
|
'Candy2',
|
||||||
|
'Cloud',
|
||||||
|
'Cyane',
|
||||||
|
'Default',
|
||||||
|
'Departure',
|
||||||
|
'Drywet',
|
||||||
'Fairy Reaf',
|
'Fairy Reaf',
|
||||||
'Semi Blue',
|
'Fire',
|
||||||
'Pink Candy',
|
'Forest',
|
||||||
'Red Reaf',
|
'Grintage',
|
||||||
'Aqua Flash',
|
'Hult',
|
||||||
'Yelblu Hot',
|
'Hult 64',
|
||||||
|
'Icefire',
|
||||||
|
'Jul',
|
||||||
|
'Landscape',
|
||||||
|
'Lava',
|
||||||
|
'Light Pink',
|
||||||
'Lite Light',
|
'Lite Light',
|
||||||
|
'Magenta',
|
||||||
|
'Magred',
|
||||||
|
'Ocean',
|
||||||
|
'Orange & Teal',
|
||||||
|
'Orangery',
|
||||||
|
'Party',
|
||||||
|
'Pastel',
|
||||||
|
'Pink Candy',
|
||||||
|
'Rainbow',
|
||||||
|
'Rainbow Bands',
|
||||||
|
'Red & Blue',
|
||||||
'Red Flash',
|
'Red Flash',
|
||||||
'Blink Red',
|
'Red Reaf',
|
||||||
'Red Shift',
|
'Red Shift',
|
||||||
'Red Tide',
|
'Red Tide',
|
||||||
'Candy2',
|
'Retro Clown',
|
||||||
|
'Rewhi',
|
||||||
|
'Rivendell',
|
||||||
|
'Sakura',
|
||||||
|
'Semi Blue',
|
||||||
|
'Sherbet',
|
||||||
|
'Splash',
|
||||||
|
'Sunset',
|
||||||
|
'Sunset 2',
|
||||||
|
'Temperature',
|
||||||
|
'Tertiary',
|
||||||
|
'Tiamat',
|
||||||
|
'Toxy Reaf',
|
||||||
|
'Vintage',
|
||||||
|
'Yelblu',
|
||||||
|
'Yelblu Hot',
|
||||||
|
'Yellowout',
|
||||||
|
'Yelmag',
|
||||||
]),
|
]),
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -187,77 +187,77 @@
|
|||||||
'area_id': None,
|
'area_id': None,
|
||||||
'capabilities': dict({
|
'capabilities': dict({
|
||||||
'options': list([
|
'options': list([
|
||||||
'Default',
|
|
||||||
'* Random Cycle',
|
|
||||||
'* Color 1',
|
'* Color 1',
|
||||||
'* Colors 1&2',
|
|
||||||
'* Color Gradient',
|
'* Color Gradient',
|
||||||
|
'* Colors 1&2',
|
||||||
'* Colors Only',
|
'* Colors Only',
|
||||||
'Party',
|
'* Random Cycle',
|
||||||
'Cloud',
|
|
||||||
'Lava',
|
|
||||||
'Ocean',
|
|
||||||
'Forest',
|
|
||||||
'Rainbow',
|
|
||||||
'Rainbow Bands',
|
|
||||||
'Sunset',
|
|
||||||
'Rivendell',
|
|
||||||
'Breeze',
|
|
||||||
'Red & Blue',
|
|
||||||
'Yellowout',
|
|
||||||
'Analogous',
|
'Analogous',
|
||||||
'Splash',
|
|
||||||
'Pastel',
|
|
||||||
'Sunset 2',
|
|
||||||
'Beach',
|
|
||||||
'Vintage',
|
|
||||||
'Departure',
|
|
||||||
'Landscape',
|
|
||||||
'Beech',
|
|
||||||
'Sherbet',
|
|
||||||
'Hult',
|
|
||||||
'Hult 64',
|
|
||||||
'Drywet',
|
|
||||||
'Jul',
|
|
||||||
'Grintage',
|
|
||||||
'Rewhi',
|
|
||||||
'Tertiary',
|
|
||||||
'Fire',
|
|
||||||
'Icefire',
|
|
||||||
'Cyane',
|
|
||||||
'Light Pink',
|
|
||||||
'Autumn',
|
|
||||||
'Magenta',
|
|
||||||
'Magred',
|
|
||||||
'Yelmag',
|
|
||||||
'Yelblu',
|
|
||||||
'Orange & Teal',
|
|
||||||
'Tiamat',
|
|
||||||
'April Night',
|
'April Night',
|
||||||
'Orangery',
|
'Aqua Flash',
|
||||||
'C9',
|
|
||||||
'Sakura',
|
|
||||||
'Aurora',
|
|
||||||
'Atlantica',
|
'Atlantica',
|
||||||
|
'Aurora',
|
||||||
|
'Aurora 2',
|
||||||
|
'Autumn',
|
||||||
|
'Beach',
|
||||||
|
'Beech',
|
||||||
|
'Blink Red',
|
||||||
|
'Breeze',
|
||||||
|
'C9',
|
||||||
'C9 2',
|
'C9 2',
|
||||||
'C9 New',
|
'C9 New',
|
||||||
'Temperature',
|
|
||||||
'Aurora 2',
|
|
||||||
'Retro Clown',
|
|
||||||
'Candy',
|
'Candy',
|
||||||
'Toxy Reaf',
|
'Candy2',
|
||||||
|
'Cloud',
|
||||||
|
'Cyane',
|
||||||
|
'Default',
|
||||||
|
'Departure',
|
||||||
|
'Drywet',
|
||||||
'Fairy Reaf',
|
'Fairy Reaf',
|
||||||
'Semi Blue',
|
'Fire',
|
||||||
'Pink Candy',
|
'Forest',
|
||||||
'Red Reaf',
|
'Grintage',
|
||||||
'Aqua Flash',
|
'Hult',
|
||||||
'Yelblu Hot',
|
'Hult 64',
|
||||||
|
'Icefire',
|
||||||
|
'Jul',
|
||||||
|
'Landscape',
|
||||||
|
'Lava',
|
||||||
|
'Light Pink',
|
||||||
'Lite Light',
|
'Lite Light',
|
||||||
|
'Magenta',
|
||||||
|
'Magred',
|
||||||
|
'Ocean',
|
||||||
|
'Orange & Teal',
|
||||||
|
'Orangery',
|
||||||
|
'Party',
|
||||||
|
'Pastel',
|
||||||
|
'Pink Candy',
|
||||||
|
'Rainbow',
|
||||||
|
'Rainbow Bands',
|
||||||
|
'Red & Blue',
|
||||||
'Red Flash',
|
'Red Flash',
|
||||||
'Blink Red',
|
'Red Reaf',
|
||||||
'Red Shift',
|
'Red Shift',
|
||||||
'Red Tide',
|
'Red Tide',
|
||||||
'Candy2',
|
'Retro Clown',
|
||||||
|
'Rewhi',
|
||||||
|
'Rivendell',
|
||||||
|
'Sakura',
|
||||||
|
'Semi Blue',
|
||||||
|
'Sherbet',
|
||||||
|
'Splash',
|
||||||
|
'Sunset',
|
||||||
|
'Sunset 2',
|
||||||
|
'Temperature',
|
||||||
|
'Tertiary',
|
||||||
|
'Tiamat',
|
||||||
|
'Toxy Reaf',
|
||||||
|
'Vintage',
|
||||||
|
'Yelblu',
|
||||||
|
'Yelblu Hot',
|
||||||
|
'Yellowout',
|
||||||
|
'Yelmag',
|
||||||
]),
|
]),
|
||||||
}),
|
}),
|
||||||
'config_entry_id': <ANY>,
|
'config_entry_id': <ANY>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user