request device info

This commit is contained in:
Robert Martin
2020-01-28 23:27:32 +09:00
parent 60ad6298df
commit ed847601cf
7 changed files with 143 additions and 50 deletions
+20
View File
@@ -0,0 +1,20 @@
import enum
class Controller(enum.Enum):
JOYCON_L = 0x01
JOYCON_R = 0x02
PRO_CONTROLLER = 0x03
def device_name(self):
"""
:returns corresponding bluetooth device name
"""
if self == Controller.JOYCON_L:
return 'Joy-Con (L)'
elif self == Controller.JOYCON_R:
return 'Joy-Con (R)'
elif self == Controller.PRO_CONTROLLER:
return 'Pro Controller'
else:
raise NotImplementedError()