Switch BLE scanner to active mode — bleak 0.20 passive requires or_patterns on BlueZ

Passive mode fails on Debian bookworm bleak 0.20.2 without or_patterns filter.
Active mode is functionally equivalent for building-level presence detection
and actually yields more complete advertisement data including device names.
This commit is contained in:
Cobra
2026-04-10 06:37:30 -04:00
parent 85e53fed68
commit c0b91e9b0b
+2 -2
View File
@@ -256,8 +256,8 @@ async def scan_loop():
await on_arrival(name, mac, rssi)
# Passive scanner — no SCAN_REQ packets sent
async with BleakScanner(detection_callback=detection_callback, scanning_mode="passive") as scanner:
# Active scanner — sends SCAN_REQ to get full advertisement data including device names
async with BleakScanner(detection_callback=detection_callback) as scanner:
try:
while not shutdown_event.is_set():
await asyncio.sleep(1)