Skip to content

Commit 8f905a4

Browse files
authored
fix: Local USB Bluetooth detection (#387) fixes #386
* fix: Local USB Bluetooth detection - fixes Failed to find Scanner (local USB Bluetooth) #386 - linting * - linting
1 parent 6c670b7 commit 8f905a4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

custom_components/bermuda/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def __init__(
153153

154154
self._manager: HomeAssistantBluetoothManager = _get_manager(hass) # instance of the bluetooth manager
155155
self._hascanners: set[BaseHaScanner] # Links to the backend scanners
156-
self._hascanner_timestamps: dict[str, dict[str, float]] = {} # scanner_address, device_address, stamp
156+
self._hascanner_timestamps: dict[str, dict[str, float]] = {} # scanner_address, device_address, stamp
157157

158158
self._entity_registry = er.async_get(self.hass)
159159
self._device_registry = dr.async_get(self.hass)
@@ -1121,7 +1121,7 @@ def _refresh_scanners(self, scanners: list[BluetoothScannerDevice] | None = None
11211121
scanner_devreg = self._device_registry.async_get_device(
11221122
connections={
11231123
("mac", scanner_address), # Matches ESPHome proxies, Shellys etc
1124-
("bluetooth", scanner_address), # Matches local USB Bluetooth (hci0..)
1124+
("bluetooth", scanner_address.upper()), # Matches local USB Bluetooth (hci0..)
11251125
}
11261126
)
11271127
if scanner_devreg is None:

custom_components/bermuda/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _handle_coordinator_update(self) -> None:
184184
"""
185185
self.async_write_ha_state()
186186

187-
def _cached_ratelimit(self, statevalue: Any, interval:int|None=None):
187+
def _cached_ratelimit(self, statevalue: Any, interval: int | None = None):
188188
"""A simple way to rate-limit sensor updates."""
189189
if interval is not None:
190190
self._cache_ratelimit_interval = interval

0 commit comments

Comments
 (0)