Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bleak can not work on macOS Catalina 10.15.3 #1286

Closed
volca opened this issue Apr 24, 2023 · 2 comments
Closed

bleak can not work on macOS Catalina 10.15.3 #1286

volca opened this issue Apr 24, 2023 · 2 comments
Labels
3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend

Comments

@volca
Copy link

volca commented Apr 24, 2023

  • bleak version: 0.19.1
  • Python version: 3.10.6_1
  • Operating System: macOS Catalina 10.15.3
  • BlueZ version (bluetoothctl -v) in case of Linux:

Description

bleak can not work with homeassistant 2023.4.5.

Logs

The log

AttributeError: 'NSKVONotifying_CBCentralManager' object has no attribute 'retrieveAddressForPeripheral_'
2023-04-24 09:00:09.579 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback CentralManagerDelegate.did_discover_peripheral(<CBCentralMan...x7fd8f8c93d20>, <CBPeripheral... disconnected>, {
    kCBAdvD... 01fea2c5 };
}, -74)
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/xxx/.homeassistant/deps/lib/python/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py", line 265, in did_discover_peripheral
    callback(peripheral, advertisementData, RSSI)
  File "/Users/xxx/.homeassistant/deps/lib/python/site-packages/bleak/backends/corebluetooth/scanner.py", line 136, in callback
@dlech dlech added 3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend labels Apr 24, 2023
@dlech
Copy link
Collaborator

dlech commented Apr 24, 2023

As mentioned in the docs, this is using an undocumented method and is not guaranteed to work. I would suggest to Home Assistant to have a fallback instead of relying on this hack.

https://bleak.readthedocs.io/en/latest/backends/macos.html#bleak.backends.corebluetooth.scanner.CBScannerArgs.use_bdaddr

@dlech
Copy link
Collaborator

dlech commented Jul 19, 2023

I will accept a pull request if someone with an older version of macOS can figure out a workaround, but I don't have anything older than macOS 12 and it is working on that version so I am not able to solve the issue myself.

@dlech dlech closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
dlech added a commit that referenced this issue Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend
Projects
None yet
Development

No branches or pull requests

2 participants