diff options
| author | Zoltan Szabatin <[email protected]> | 2025-03-02 17:55:18 -0800 |
|---|---|---|
| committer | Zoltan Szabatin <[email protected]> | 2025-03-02 17:55:18 -0800 |
| commit | 4802f7f9d965c1014c710aeb024d090845a5b7bf (patch) | |
| tree | c572d87616d6c82af35d829fc9fb2745552d29b8 /src/splitscreen_duo/__init__.py | |
| parent | refactor: Move serial controller up hierarchy (diff) | |
| download | splitscreen-duo-4802f7f9d965c1014c710aeb024d090845a5b7bf.tar.xz splitscreen-duo-4802f7f9d965c1014c710aeb024d090845a5b7bf.zip | |
feat: Add proper command options
Diffstat (limited to 'src/splitscreen_duo/__init__.py')
| -rw-r--r-- | src/splitscreen_duo/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/splitscreen_duo/__init__.py b/src/splitscreen_duo/__init__.py index 90d54ab..e47c7cb 100644 --- a/src/splitscreen_duo/__init__.py +++ b/src/splitscreen_duo/__init__.py @@ -1,4 +1,5 @@ from . import menu +from .command import Command import os import logging import pygame @@ -32,8 +33,8 @@ def main() -> int: message = json.loads(data) - if message.get("action") == "QUIT_ALL": - logger.info("received quit_all command from primary, shutting down") + if message.get("command") == Command.QUIT.value: + logger.info("received quit command from primary, shutting down") pygame.quit() return 0 @@ -49,8 +50,8 @@ def main() -> int: if serial_command: serial.write(json.dumps(serial_command).encode("utf-8")) - if serial_command.get("action") == "QUIT_ALL": - logger.info("primary sent quit_all, shutting down") + if serial_command.get("command") == Command.QUIT.value: + logger.info("primary sent quit, shutting down") pygame.quit() return 0 |