Skip to content

Commit

Permalink
Revising _refresh_scanners
Browse files Browse the repository at this point in the history
- changes to support finding usb bluetooth adaptors
  • Loading branch information
agittins committed Aug 25, 2023
1 parent 15d23b5 commit 8232607
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions custom_components/bermuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,13 @@ def _refresh_scanners(self, address=None):
for dev_entry in self.hass.data["device_registry"].devices.data.values():
if len(dev_entry.connections) > 0:
for dev_connection in dev_entry.connections:
if dev_connection[0] == "mac":
if address is None or address == dev_connection[1]:
if dev_connection[0] in ["mac", "bluetooth"]:
if (
address is None
or str(address).upper() == str(dev_connection[1]).upper()
):
found_address = dev_connection[1]
self.devices[found_address] = BermudaDevice()
self.devices[str(found_address).upper()] = BermudaDevice()
scandev = self.devices[found_address]
scandev.address = found_address
scandev.area_id = dev_entry.area_id
Expand Down

0 comments on commit 8232607

Please sign in to comment.