Skip to content

Commit 2150580

Browse files
Fix: hid.py BLEHID
1 parent 5c404ff commit 2150580

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

kmk/hid.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -347,20 +347,20 @@ def devices(self):
347347
return self.hid.devices
348348

349349
def ble_monitor(self):
350-
if self.ble_connected != self.connected:
350+
if debug.enabled and self.ble_connected != self.connected:
351351
self.ble_connected = self.connected
352352
if self.connected:
353-
if debug.enabled:
354-
debug('BLE connected')
353+
debug('BLE connected')
355354
else:
356-
# Security-wise this is not right. While you're away someone turns
357-
# on your keyboard and they can pair with it nice and clean and then
358-
# listen to keystrokes.
359-
# On the other hand we don't have LESC so it's like shouting your
360-
# keystrokes in the air
361-
self.start_advertising()
362-
if debug.enabled:
363-
debug('BLE disconnected')
355+
debug('BLE disconnected')
356+
357+
if not self.connected:
358+
# Security-wise this is not right. While you're away someone turns
359+
# on your keyboard and they can pair with it nice and clean and then
360+
# listen to keystrokes.
361+
# On the other hand we don't have LESC so it's like shouting your
362+
# keystrokes in the air
363+
self.start_advertising()
364364

365365
def clear_bonds(self):
366366
import _bleio

0 commit comments

Comments
 (0)