if self.ml_overrides.get(seq,{}).get('pattern') and False:
That always evaluates to False, and as such, the pattern from ml_overrides is never used. When using mlapi, this makes it impossible to override the mlapi configuration pattern via parameters passed in via a zm_detect request. This PR fixes that issue, so that zm_detect can override patterns on a global, per-monitor, or per-zone basis as described in the documentation.
This PR also includes some additional Debug 2 logging to assist in troubleshooting issues like this, and replaces a copy operation on the polygons list with a deepcopy, as copies of nested data structures should generally be deep as opposed to shallow.
The current pyzm code contains this line:
That always evaluates to False, and as such, the
pattern
fromml_overrides
is never used. When using mlapi, this makes it impossible to override the mlapi configuration pattern via parameters passed in via a zm_detect request. This PR fixes that issue, so that zm_detect can override patterns on a global, per-monitor, or per-zone basis as described in the documentation.This PR also includes some additional Debug 2 logging to assist in troubleshooting issues like this, and replaces a
copy
operation on the polygons list with adeepcopy
, as copies of nested data structures should generally be deep as opposed to shallow.