From 03e2c736ca56b685652d59dbd2c18d83e275bc1d Mon Sep 17 00:00:00 2001 From: Marcel Schaeben Date: Sat, 23 Nov 2024 13:57:46 +0100 Subject: [PATCH] wip --- main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 18b1dde..7f2f782 100755 --- a/main.py +++ b/main.py @@ -21,7 +21,13 @@ from PyQt6.uic import loadUi from send2trash import send2trash -from bt_controller_controller import BtControllerController, BtControllerCommand, BtControllerRequest, BtControllerState + +try: + from bt_controller_controller import BtControllerController, BtControllerCommand, BtControllerRequest, BtControllerState + BT_AVAILABLE = True +except: + BT_AVAILABLE = False + from camera_worker import CameraWorker, CaptureImagesRequest, CameraStates, PropertyChangeEvent, ConfigRequest from open_session_dialog import OpenSessionDialog from photo_browser import PhotoBrowser @@ -900,8 +906,10 @@ def excepthook(exc_type, exc_value, exc_traceback): with loop: - if BtControllerController.BLEAK_AVAILABLE and QSettings().value("enableBluetooth", type=bool): + if BT_AVAILABLE and QSettings().value("enableBluetooth", type=bool): loop.create_task(win.init_bluetooth()) + else: + logging.info("Bluetooth not available. Is bleak installed?") loop.run_until_complete(app_close_event.wait())