Enhance device down event handling for sleeping devices and improve down alerts query

This commit is contained in:
Jokob @NetAlertX
2026-03-02 10:05:37 +00:00
parent 67aa46f1cf
commit 3a73817048
5 changed files with 229 additions and 54 deletions

View File

@@ -207,9 +207,9 @@ def insert_device(
# ---------------------------------------------------------------------------
def down_event_macs(cur) -> set:
"""Return the set of MACs that have a 'Device Down' event row."""
"""Return the set of MACs that have a 'Device Down' event row (lowercased)."""
cur.execute("SELECT eve_MAC FROM Events WHERE eve_EventType = 'Device Down'")
return {r["eve_MAC"] for r in cur.fetchall()}
return {r["eve_MAC"].lower() for r in cur.fetchall()}
# ---------------------------------------------------------------------------