From 82326076b8d5a9ba25515b2637eca0f7d4037d9f Mon Sep 17 00:00:00 2001 From: Ashley Gittins Date: Fri, 25 Aug 2023 14:02:44 +0000 Subject: [PATCH] Revising _refresh_scanners - changes to support finding usb bluetooth adaptors --- custom_components/bermuda/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/custom_components/bermuda/__init__.py b/custom_components/bermuda/__init__.py index fc0dd74..0520f34 100644 --- a/custom_components/bermuda/__init__.py +++ b/custom_components/bermuda/__init__.py @@ -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