Skip to content
Snippets Groups Projects
Commit 95662609 authored by frigi's avatar frigi
Browse files

trigger cheers image with LCD cheers message

parent a358164f
No related branches found
No related tags found
1 merge request!6trigger cheers image with LCD cheers message
......@@ -283,6 +283,7 @@ class Coordinator():
if self.balance_available > 0:
self.pending_vend = True
self.show_cheers_message()
self.websocket.trigger_cheers_image()
return True
return False
......@@ -292,7 +293,6 @@ class Coordinator():
if successful:
self.balance_available -= 1
self.logger.debug('Dispensed a beer for RFID ' + str(self.rfid) + '(org: ' + self.org + ')')
self.websocket.report_dispensed_beer(self.rfid, self.org)
self.communicator.report_dispensed_beer(self.rfid, self.org)
if self.pending_vend:
......
......@@ -35,6 +35,9 @@ class Websocket(Thread):
def report_dispensed_beer(self, rfid, org):
websockets.broadcast(self.connections, f"{{'rfid': '{rfid}', 'org': '{org}'}}")
def trigger_cheers_image(self):
websockets.broadcast(self.connections, "beer_triggered")
def stop(self):
"""Terminate the thread."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment