Seed last_seen from ARP cache on startup so watchdog has a baseline

Without this, last_seen is empty after every restart and the watchdog
skips all devices (ts is None → continue). Devices that are genuinely
active refresh last_seen via ARP requests or mDNS. AP proxy ghosts only
send ARP replies (now filtered), so they go silent and the watchdog
fires departure after WATCHDOG_TIMEOUT_SEC.
This commit is contained in:
Cobra
2026-04-14 16:07:47 -04:00
parent 51fff82867
commit 936e33d373
+6
View File
@@ -821,6 +821,12 @@ def seed_from_arp_cache():
if ip in infrastructure_ips:
dev['infrastructure'] = True
known_devices[mac] = dev
# Seed last_seen so the watchdog has a baseline.
# Devices that are genuinely active will refresh this via ARP
# requests or mDNS; AP proxy ghosts (only ARP replies) won't.
with last_seen_lock:
if mac not in last_seen:
last_seen[mac] = time.time()
logging.info(f"Seeded {len(known_devices)} devices from ARP cache")
except Exception as e: