- preconnect phone before checking BT modem

This commit is contained in:
2023-09-06 20:03:50 +03:00
parent 1256f3ad21
commit eccf8d1934
3 changed files with 17 additions and 6 deletions

View File

@@ -42,13 +42,18 @@ class CallState(bt_phone.Observer):
# Listen to call changes
CALL_STATE_EVENT = CallState()
PHONE = bt_phone.Phone()
PHONE.addObserver(CALL_STATE_EVENT)
CALL_STATE_EVENT = None
PHONE = None
# virtualmic module
PA_MODULE_IDX = -1
def init():
global CALL_STATE_EVENT, PHONE
CALL_STATE_EVENT = CallState()
PHONE = bt_phone.Phone()
PHONE.addObserver(CALL_STATE_EVENT)
# Set volume 0..100%
def set_headset_spk_volume(vol: float):