From 768721ab1e052673bb1b8d247725eee589e3032e Mon Sep 17 00:00:00 2001 From: Scott Petersen Date: Wed, 22 May 2013 12:01:46 -0700 Subject: [PATCH] Test --- pyad2usb/ad2usb.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pyad2usb/ad2usb.py b/pyad2usb/ad2usb.py index 0c98039..ea5c787 100644 --- a/pyad2usb/ad2usb.py +++ b/pyad2usb/ad2usb.py @@ -240,7 +240,7 @@ class Message(object): Represents a message from the alarm panel. """ - def __init__(self): + def __init__(self, data=None): """ Constructor """ @@ -261,6 +261,17 @@ class Message(object): self._cursor = -1 self._raw = "" + if data is not None: + self._parse_message(data) + + def _parse_message(self, data): + pattern = '("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*),("(?:[^"]|"")*"|[^,]*)' + + + + + pass + @property def ignore_packet(self): """