[ble] Add support to clear all current bondings
This commit is contained in:
committed by
Kyle Brown
parent
e5700eeb5f
commit
2cf64d8ce7
@@ -63,3 +63,8 @@ class BLEHID(AbstractHID):
|
||||
return self.devices[reporting_device_const].send_report(
|
||||
evt[1 : report_size + 1]
|
||||
)
|
||||
|
||||
def clear_bonds(self):
|
||||
import _bleio
|
||||
|
||||
_bleio.adapter.erase_bonding()
|
||||
|
@@ -254,3 +254,8 @@ def led_mode_breathe(key, state, *args, **kwargs):
|
||||
state.config.led.effect_init = True
|
||||
state.config.led.animation_mode = 'breathing'
|
||||
return state
|
||||
|
||||
|
||||
def bt_clear_bonds(key, state, *args, **kwargs):
|
||||
state.config._hid_helper_inst.clear_bonds()
|
||||
return state
|
||||
|
@@ -641,6 +641,7 @@ make_key(names=('LED_ANI',), on_press=handlers.led_ani)
|
||||
make_key(names=('LED_AND',), on_press=handlers.led_and)
|
||||
make_key(names=('LED_MODE_PLAIN', 'LED_M_P'), on_press=handlers.led_mode_static)
|
||||
make_key(names=('LED_MODE_BREATHE', 'LED_M_B'), on_press=handlers.led_mode_breathe)
|
||||
make_key(names=('BT_CLEAR_BONDS', 'BT_CLR'), on_press=handlers.bt_clear_bonds)
|
||||
|
||||
|
||||
make_key(
|
||||
|
Reference in New Issue
Block a user