Skip unwanted event types

e.g DISCONNECT events never have video associated with them, skip
processing if we encounter events of types we are not interested in.

Co-authored-by: Sebastian Goscik <sebastian.goscik@live.co.uk>
This commit is contained in:
Anthony Ferrara
2022-03-26 11:38:23 -04:00
committed by Sebastian Goscik
parent af8ca90356
commit f2c9ee5c76

View File

@@ -425,6 +425,8 @@ class UnifiProtectBackup:
return
if msg.new_obj.end is None:
return
if msg.new_obj.type not in [EventType.MOTION, EventType.SMART_DETECT, EventType.RING]:
return
if msg.new_obj.type is EventType.MOTION and "motion" not in self.detection_types:
logger.extra_debug(f"Skipping unwanted motion detection event: {msg.new_obj.id}") # type: ignore
return