Handle pet and wildlife events in event processor

This commit is contained in:
Aaron D. Lee
2026-04-03 13:20:46 -04:00
parent 53daf58c78
commit d0acf7703c
2 changed files with 69 additions and 0 deletions

View File

@@ -127,6 +127,21 @@ class EventProcessor:
if suffix in _TOPIC_EVENT_MAP:
etype, sev = _TOPIC_EVENT_MAP[suffix]
return etype, sev, camera_id
# Pet detection
if suffix == "pet/detected":
return EventType.PET_DETECTED, Severity.INFO, camera_id
# Wildlife detection — severity depends on threat_level in payload
if suffix == "wildlife/detected":
threat = payload.get("threat_level", "PASSIVE")
if threat == "PREDATOR":
return EventType.WILDLIFE_PREDATOR, Severity.CRITICAL, camera_id
elif threat == "NUISANCE":
return EventType.WILDLIFE_NUISANCE, Severity.WARNING, camera_id
else:
return EventType.WILDLIFE_PASSIVE, Severity.INFO, camera_id
# Ignore heartbeats etc.
return None, None, None