Move the check for a change in active status into the code block protected by a false positive check.

This commit is contained in:
gwmullin 2024-08-22 16:49:13 -07:00
parent 8a762994be
commit 8de74f0b2f

View File

@ -166,9 +166,8 @@ class TrackedObject:
if self.computed_score > self.top_score: if self.computed_score > self.top_score:
self.top_score = self.computed_score self.top_score = self.computed_score
self.false_positive = self._is_false_positive() self.false_positive = self._is_false_positive()
if not self.active == self.is_active(): # Hold previous active state for checking further down.
# State transition between stationary/active. previously_active = self.active
significant_change = True
self.active = self.is_active() self.active = self.is_active()
if not self.false_positive: if not self.false_positive:
@ -254,7 +253,9 @@ class TrackedObject:
if self.obj_data["attributes"] != obj_data["attributes"]: if self.obj_data["attributes"] != obj_data["attributes"]:
significant_change = True significant_change = True
# if the state changed between stationary and active
if previously_active != self.active:
significant_change = True
# update at least once per minute # update at least once per minute
if self.obj_data["frame_time"] - self.previous["frame_time"] > 60: if self.obj_data["frame_time"] - self.previous["frame_time"] > 60: