From cc63fe8429b86d02c7442432c713ecc5eb2344d9 Mon Sep 17 00:00:00 2001 From: Cobra Date: Tue, 14 Apr 2026 16:07:47 -0400 Subject: [PATCH] Seed last_seen from ARP cache on startup so watchdog has a baseline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- net_alerter/net_alerter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net_alerter/net_alerter.py b/net_alerter/net_alerter.py index 9ddc1ce..00f8b03 100644 --- a/net_alerter/net_alerter.py +++ b/net_alerter/net_alerter.py @@ -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: