From 1e3318589ed19c52fc3fdf846627a3af9f32f12f Mon Sep 17 00:00:00 2001 From: Scott Petersen Date: Fri, 10 Jan 2014 12:15:57 -0800 Subject: [PATCH] Fixed incorrect optional header for keypad messages. --- alarmdecoder/decoder.py | 2 +- alarmdecoder/messages.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index 0257638..568de9d 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -300,7 +300,7 @@ class AlarmDecoder(object): msg = None header = data[0:4] - if header[0] != '!' or header == '!KPE': + if header[0] != '!' or header == '!KPM': msg = self._handle_keypad_message(data) elif header == '!EXP' or header == '!REL': diff --git a/alarmdecoder/messages.py b/alarmdecoder/messages.py index 6acb107..a5d67cf 100644 --- a/alarmdecoder/messages.py +++ b/alarmdecoder/messages.py @@ -97,7 +97,7 @@ class Message(BaseMessage): """ 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: self._parse_message(data)