merged run_amiibo_cli with run_controller_cli; some cleanups

This commit is contained in:
Robert Martin
2020-04-30 20:44:07 +02:00
parent be8dce71a0
commit c17ab21140
6 changed files with 87 additions and 154 deletions
+11
View File
@@ -18,3 +18,14 @@ class Controller(enum.Enum):
return 'Pro Controller'
else:
raise NotImplementedError()
@staticmethod
def from_arg(arg):
if arg == 'JOYCON_R':
return Controller.JOYCON_R
elif arg == 'JOYCON_L':
return Controller.JOYCON_L
elif arg == 'PRO_CONTROLLER':
return Controller.PRO_CONTROLLER
else:
raise ValueError(f'Unknown controller "{arg}".')