Skip to content

Commit

Permalink
Restart the application if the emergency bottle is scanned (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
soerface authored Nov 12, 2024
1 parent e0f662a commit 565ef6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drinks_touch/tasks/barcode_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import config
from env import is_pi
from tasks.run_cmd import CheckoutAndRestartTask

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -56,6 +57,12 @@ def kill():
def on_barcode(barcode):
screen = ScreenManager.get_instance().get_active()

if barcode == "RESTART":
from screens.tasks_screen import TasksScreen

screen.goto(TasksScreen(screen.screen, [CheckoutAndRestartTask("master")]))
return

if hasattr(screen, "on_barcode"):
screen.on_barcode(barcode)

Expand Down

0 comments on commit 565ef6e

Please sign in to comment.