Skip to content

Commit

Permalink
'all' query: return devices sorted by last_seen date
Browse files Browse the repository at this point in the history
  • Loading branch information
Perdu committed Jan 19, 2020
1 parent 7fa95a5 commit 677adbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/server.py
Expand Up @@ -418,7 +418,7 @@ def handle(self):
self.request.sendall(json.dumps(j))
else:
if not PRODUCTION and self.data == "all":
dic = {"devices": device_list.keys()}
dic = {"devices": sorted(device_list, key=lambda x: device_list[x].last_seen)}
dic["message"] = ""
j = json.dumps(dic)
self.request.sendall(j)
Expand Down

0 comments on commit 677adbd

Please sign in to comment.