Thanks to visit codestin.com
Credit goes to github.com

Skip to content

corebluetooth scanner does not check on None vallue address #1523

@rrooggiieerr

Description

@rrooggiieerr
  • bleak version: 0.21.1
  • Python version: 3.11.8
  • Operating System: MacOS Sonoma 14.3
  • BlueZ version (bluetoothctl -v) in case of Linux:

Description

The following exception was logged on my local Home Assistance instance:

2024-03-15 12:21:46.815 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback CentralManagerDelegate.did_discover_peripheral(<CBCentralMan...x60000154d5e0>, <CBPeripheral... disconnected>, {
    kCBAdvD...rLevel = 12;
}, -103)
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/rogier/workspaces/HomeAssistant/homeassistant-core/venv/lib/python3.11/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py", line 265, in did_discover_peripheral
    callback(peripheral, advertisementData, RSSI)
  File "/Users/rogier/workspaces/HomeAssistant/homeassistant-core/venv/lib/python3.11/site-packages/bleak/backends/corebluetooth/scanner.py", line 133, in callback
    address = address_bytes.hex(":").upper()
              ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'hex'

address_bytes is not checked on being None

What I Did

Just running Home Assistant

Logs

See above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backend: Core BluetoothIssues and PRs relating to the Core Bluetooth backendbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions