HappyLighting-py icon indicating copy to clipboard operation
HappyLighting-py copied to clipboard

Bleak error

Open ImShEthan opened this issue 9 months ago • 6 comments

Hello, i'm having trouble when scanning, got this error :

libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\qasync\__init__.py", line 780, in _error_handler
    task.result()
  File "C:\Users\Tatane\Downloads\HappyLighting-py-master\LEDStripController\pyhl.py", line 284, in handle_scan
    devices = await BLEClass.BleakScanner.discover(timeout=8.0)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\__init__.py", line 320, in discover
    async with cls(**kwargs) as scanner:
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\__init__.py", line 158, in __aenter__
    await self._backend.start()
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\backends\winrt\scanner.py", line 222, in start
    assert_mta()
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\backends\winrt\util.py", line 78, in assert_mta
    raise BleakError(
bleak.exc.BleakError: The current thread apartment type is not MTA: STA. Beware of packages like pywin32 that may change the apartment type implicitly.

ImShEthan avatar May 18 '24 18:05 ImShEthan