diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2025-07-20 15:51:59 +0200 | 
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2025-07-20 15:51:59 +0200 | 
| commit | a4382ed71254dfb8e5eed0a6849e7710e0367cb8 (patch) | |
| tree | 4a20726d141c3a689a3acda1c9ce5aca2ab37ee0 | |
| parent | c31148f482adf44ded7cec1d683e01d995294850 (diff) | |
When disconnected, sleep between scanning events
| -rw-r--r-- | serial_conn.py | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/serial_conn.py b/serial_conn.py index 4e885b2..0775ba0 100644 --- a/serial_conn.py +++ b/serial_conn.py @@ -1,8 +1,8 @@ -from kmk.modules import Module -from usb_cdc import data  import json +import time -import json_layer +from kmk.modules import Module +from usb_cdc import data  class Client(Module):      """ Listen the connections from host, and apply the actions depending of @@ -28,6 +28,7 @@ class Client(Module):          if not data.connected:              keyboard.keymap[0].name = "Disconnected" +            time.sleep(1)              return          # Nothing to parse.  | 
