diff options
Diffstat (limited to 'serial_conn.py')
| -rw-r--r-- | serial_conn.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/serial_conn.py b/serial_conn.py index a781d64..7645563 100644 --- a/serial_conn.py +++ b/serial_conn.py @@ -4,6 +4,7 @@ import time from kmk.modules import Module from usb_cdc import data + class Client(Module): """ Listen the connections from host, and apply the actions depending of the json command. @@ -31,13 +32,12 @@ class Client(Module): if current_name != "Disconnected": self.last_name = current_name keyboard.keymap[0].name = "Disconnected" - time.sleep(1) + # time.sleep(1) return if self.last_name is not None: keyboard.keymap[0].name = self.last_name self.last_name = None - # Nothing to parse. if data.in_waiting <= 0: return @@ -53,7 +53,7 @@ class Client(Module): jdata = json.loads(content) except ValueError as err: # In circuitPython, json error are reported as ValueError. - # seet https://docs.circuitpython.org/en/latest/docs/library/json.html#json.load + # see https://docs.circuitpython.org/en/latest/docs/library/json.html#json.load print(err, line) return @@ -61,7 +61,7 @@ class Client(Module): # direct raw layer instruction if this does not work. actions = { - "layer" : lambda x : keyboard.keymap[0].load(x), + "layer": lambda x: keyboard.keymap[0].load(x), } try: |
