Browse Source

Added a limiter to the automatic sending of '*' when a specific message is displayed to avoid flooding the panel in weird cases.

pyserial_fix
Scott Petersen 7 years ago
parent
commit
2070c0b701
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      alarmdecoder/decoder.py

+ 7
- 2
alarmdecoder/decoder.py View File

@@ -122,6 +122,9 @@ class AlarmDecoder(object):
self._panic_status = False
self._relay_status = {}
self._internal_address_mask = 0xFFFFFFFF
self.last_fault_time = 0
self.fault_expansion_time_limit = 30 # Seconds

self.address = 18
self.configbits = 0xFF00
@@ -693,8 +696,10 @@ class AlarmDecoder(object):
# NOTE: This only happens on first boot or after exiting programming mode.
if isinstance(message, Message):
if not message.ready and ("Hit * for faults" in message.text or "Press * to show faults" in message.text):
self.send('*')
return
if time.time() > self.last_fault_expansion + self.fault_expansion_time_limit:
self.last_fault_expansion = time.time()
self.send('*')
return

self._zonetracker.update(message)



Loading…
Cancel
Save