diff --git a/custom_components/vinx/media_player.py b/custom_components/vinx/media_player.py index b887885..b7d53e3 100644 --- a/custom_components/vinx/media_player.py +++ b/custom_components/vinx/media_player.py @@ -85,10 +85,11 @@ def __init__(self, lw3: LW3, device_information: DeviceInformation) -> None: _attr_supported_features = MediaPlayerEntityFeature.SELECT_SOURCE async def async_update(self): - # Populate the source list only once + # Populate the source list only once. Sort it alphabetically, since the order of discovered devices + # may differ from device to device. if self._source_list is None: await self.populate_source_bidict() - self._source_list = list(self._source_bidict.values()) + self._source_list = sorted(list(self._source_bidict.values())) _LOGGER.info(f"{self.name} source list populated with {len(self._source_list)} sources") async with self._lw3.connection():