Browse Source

Debug message cleanup.

pyserial_fix
Scott Petersen 7 years ago
parent
commit
b03fa61646
2 changed files with 0 additions and 18 deletions
  1. +0
    -16
      alarmdecoder/decoder.py
  2. +0
    -2
      alarmdecoder/messages/lrr/system.py

+ 0
- 16
alarmdecoder/decoder.py View File

@@ -597,8 +597,6 @@ class AlarmDecoder(object):
except ValueError:
alarm_zone = int(message.numeric_code, 16)

print("_update_alarm_status: status={} zone={} user={}".format(alarm_status, alarm_zone, user))

if alarm_status != self._alarm_status:
self._alarm_status, old_status = alarm_status, self._alarm_status

@@ -655,8 +653,6 @@ class AlarmDecoder(object):
arm_status = message.armed_away
stay_status = message.armed_home

print("_update_armed_status: status={} status_stay={} - arm_status={} stay_status={}".format(status, status_stay, arm_status, stay_status))

if arm_status is None or stay_status is None:
return

@@ -712,13 +708,10 @@ class AlarmDecoder(object):
fire_status = message.fire_alarm

last_status, last_update = self._fire_status
#print("_update_fire_status: fire_status={fire_status} last_status={last_status} last_update={last_update}".format(fire_status=fire_status, last_status=last_status, last_update=last_update))


if self._fire_state == FireState.NONE:
# Always move to a FIRE state if detected
if fire_status == True:
print("FIRE STATE: NONE -> ALARM")
self._fire_state = FireState.ALARM
self._fire_status = (fire_status, time.time())

@@ -727,7 +720,6 @@ class AlarmDecoder(object):
elif self._fire_state == FireState.ALARM:
# If we've received an LRR CANCEL message, move to ACKNOWLEDGED
if is_lrr and fire_status == False:
print("FIRE STATE: ALARM -> ACKNOWLEDGED")
self._fire_state = FireState.ACKNOWLEDGED
self._fire_status = (fire_status, time.time())
self.on_fire(status=FireState.ACKNOWLEDGED)
@@ -737,14 +729,12 @@ class AlarmDecoder(object):
self._fire_status = (fire_status, time.time())
if fire_status == False and time.time() > last_update + self._fire_timeout:
print("FIRE STATE: ALARM -> NONE")
self._fire_state = FireState.NONE
self.on_fire(status=FireState.NONE)

elif self._fire_state == FireState.ACKNOWLEDGED:
# If we've received a second LRR FIRE message after a CANCEL, revert back to FIRE and trigger another event.
if is_lrr and fire_status == True:
print("FIRE STATE: ACKNOWLEDGED -> ALARM")
self._fire_state = FireState.ALARM
self._fire_status = (fire_status, time.time())

@@ -754,16 +744,10 @@ class AlarmDecoder(object):
if last_status != fire_status or fire_status == True:
self._fire_status = (fire_status, time.time())

# Handle timeout to revert back to NONE.
if fire_status != True and time.time() > last_update + self._fire_timeout:
print("FIRE STATE: ACKNOWLEDGED -> NONE")
self._fire_state = FireState.NONE
self.on_fire(status=FireState.NONE)

else:
print("INVALID FIRE STATE={}".format(self._fire_state))


return self._fire_state == FireState.ALARM




+ 0
- 2
alarmdecoder/messages/lrr/system.py View File

@@ -11,8 +11,6 @@ class LRRSystem(object):
def update(self, message):
handled = False

print("LRR Message: {0}".format(message.dict()))

if message.version == 1:
if msg.event_type == 'ALARM_PANIC':
self._alarmdecoder._update_panic_status(True)


Loading…
Cancel
Save