mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
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:
parent
eedbb86b67
commit
69531593f2
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user