Browse Source

Merge pull request #52 from krkeegan/Fix_Issue_50

Improved Handling of New Zone Faults
main
Sean Mathews 4 years ago
committed by GitHub
parent
commit
6cdcd44352
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      alarmdecoder/zonetracking.py

+ 10
- 2
alarmdecoder/zonetracking.py View File

@@ -196,6 +196,9 @@ class Zonetracker(object):
self._update_zone(zone)
self._clear_zones(zone)

# Save our spot for the next message.
self._last_zone_fault = zone

else:
status = Zone.FAULT
if message.check_zone:
@@ -205,8 +208,8 @@ class Zonetracker(object):
self._zones_faulted.append(zone)
self._zones_faulted.sort()

# Save our spot for the next message.
self._last_zone_fault = zone
# A new zone fault, so it is out of sequence.
self._last_zone_fault = 0

self._clear_expired_zones()

@@ -243,6 +246,11 @@ class Zonetracker(object):
:param zone: current zone being processed
:type zone: int
"""

if self._last_zone_fault == 0:
# We don't know what the last faulted zone was, nothing to do
return

cleared_zones = []
found_last_faulted = found_current = at_end = False



Loading…
Cancel
Save