Sort Apple TV app list by name (#65386)

This commit is contained in:
Pierre Ståhl 2022-02-01 22:30:28 +01:00 committed by GitHub
parent 3718d7fca8
commit 476a694248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,7 +162,10 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
except exceptions.ProtocolError: except exceptions.ProtocolError:
_LOGGER.exception("Failed to update app list") _LOGGER.exception("Failed to update app list")
else: else:
self._app_list = {app.name: app.identifier for app in apps} self._app_list = {
app.name: app.identifier
for app in sorted(apps, key=lambda app: app.name.lower())
}
self.async_write_ha_state() self.async_write_ha_state()
@callback @callback