- preconnect phone before checking BT modem
This commit is contained in:
parent
1256f3ad21
commit
eccf8d1934
|
|
@ -472,6 +472,12 @@ if __name__ == '__main__':
|
|||
bt_ctl = Bluetoothctl()
|
||||
bt_ctl.connect(CONFIG.BT_MAC)
|
||||
utils.log(f' Done.')
|
||||
else:
|
||||
utils.log_error(f'No BT MAC specified, cannot connect. Exiting.')
|
||||
raise SystemExit(EXIT_ERROR)
|
||||
|
||||
# Init BT modem
|
||||
bt_call_controller.init()
|
||||
|
||||
# Logging settings
|
||||
utils.verbose_logging = CONFIG.Verbose
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class Phone(Observable):
|
|||
model_serial = properties['Serial']
|
||||
modem_online = properties['Online']
|
||||
|
||||
utils.log(f'Found modem: {path} name: {modem_name} serial: {model_serial} online: {modem_online}')
|
||||
# utils.log(f'Found modem: {path} name: {modem_name} serial: {model_serial} online: {modem_online}')
|
||||
if modem_online == 1:
|
||||
return path
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue