Sort minecraft_server players_online sensor's players_list (#35280)

Sort the players_list attribute of the minecraft_server players_online sensor in order to eliminate uneccessary state updates and ease comparisons in state changes.
This commit is contained in:
Sean Leonard 2020-06-02 17:01:16 -07:00 committed by GitHub
parent eedbb86b67
commit 69531593f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,6 +197,7 @@ class MinecraftServer:
if status_response.players.sample is not None:
for player in status_response.players.sample:
self.players_list.append(player.name)
self.players_list.sort()
# Inform user once about successful update if necessary.
if self._last_status_request_failed: