mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 22:48:16 +01:00
sort hardware by name
This commit is contained in:
parent
4d95017842
commit
9ac0141e4d
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.0.5.a7"
|
__version__ = "4.0.5.a8"
|
||||||
__codename__ = "Spring Break"
|
__codename__ = "Spring Break"
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@ class CBPiWebSocket:
|
||||||
for ws in self._clients:
|
for ws in self._clients:
|
||||||
async def send_data(ws, data):
|
async def send_data(ws, data):
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
|
data['data'].sort(key=lambda x: x.get('name').upper())
|
||||||
|
except:
|
||||||
|
pass
|
||||||
await ws.send_json(data=data, dumps=json_dumps)
|
await ws.send_json(data=data, dumps=json_dumps)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error("Error with client %s: %s" % (ws, str(e)))
|
self.logger.error("Error with client %s: %s" % (ws, str(e)))
|
||||||
|
|
Loading…
Reference in a new issue