Browse Source

Fixed incorrect optional header for keypad messages.

pyserial_fix
Scott Petersen 11 years ago
parent
commit
1e3318589e
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      alarmdecoder/decoder.py
  2. +1
    -1
      alarmdecoder/messages.py

+ 1
- 1
alarmdecoder/decoder.py View File

@@ -300,7 +300,7 @@ class AlarmDecoder(object):
msg = None msg = None
header = data[0:4] header = data[0:4]


if header[0] != '!' or header == '!KPE':
if header[0] != '!' or header == '!KPM':
msg = self._handle_keypad_message(data) msg = self._handle_keypad_message(data)


elif header == '!EXP' or header == '!REL': elif header == '!EXP' or header == '!REL':


+ 1
- 1
alarmdecoder/messages.py View File

@@ -97,7 +97,7 @@ class Message(BaseMessage):
""" """
BaseMessage.__init__(self) BaseMessage.__init__(self)


self._regex = re.compile('^(!KPE:){0,1}(\[[a-fA-F0-9\-]+\]),([a-fA-F0-9]+),(\[[a-fA-F0-9]+\]),(".+")$')
self._regex = re.compile('^(!KPM:){0,1}(\[[a-fA-F0-9\-]+\]),([a-fA-F0-9]+),(\[[a-fA-F0-9]+\]),(".+")$')


if data is not None: if data is not None:
self._parse_message(data) self._parse_message(data)


Loading…
Cancel
Save