mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-27 08:54:42 +03:00
send MQTT snapshot when object enters required zone (#22690)
When mqtt.required_zones is configured, the initial mqtt snapshot on object creation is always blocked because zone evaluation hasn't run yet (entered_zones is empty). Later, the snapshot is only re-sent if a better thumbnail is found, so if the first frame was already the best capture the snapshot is silently lost. Add a new_zone_entered flag to TrackedObject that triggers an mqtt snapshot publish as soon as zone entry is confirmed, closing the gap between object detection and zone evaluation. Closes blakeblackshear/frigate#21027
This commit is contained in:
@@ -61,6 +61,7 @@ class TrackedObject:
|
||||
self.zone_loitering: dict[str, int] = {}
|
||||
self.current_zones: list[str] = []
|
||||
self.entered_zones: list[str] = []
|
||||
self.new_zone_entered: bool = False
|
||||
self.attributes: dict[str, float] = defaultdict(float)
|
||||
self.false_positive = True
|
||||
self.has_clip = False
|
||||
@@ -278,6 +279,7 @@ class TrackedObject:
|
||||
|
||||
if name not in self.entered_zones:
|
||||
self.entered_zones.append(name)
|
||||
self.new_zone_entered = True
|
||||
else:
|
||||
self.zone_loitering[name] = loitering_score
|
||||
|
||||
|
||||
Reference in New Issue
Block a user