Start to parse events

parent eb80e75b
...@@ -62,6 +62,7 @@ class ParadoxProtocol(BaseProtocol): ...@@ -62,6 +62,7 @@ class ParadoxProtocol(BaseProtocol):
self.core = core self.core = core
self.cfg = cfg self.cfg = cfg
self.log.debug(str(self.cfg)) self.log.debug(str(self.cfg))
self.flags = p37b.Flags()
try: try:
self.proxyonly = genutils.isTrue(self.cfg.get('connection', 'proxyonly')) self.proxyonly = genutils.isTrue(self.cfg.get('connection', 'proxyonly'))
self.mapnames = genutils.isTrue(self.cfg.get('panel', 'mapNames')) self.mapnames = genutils.isTrue(self.cfg.get('panel', 'mapNames'))
...@@ -219,7 +220,22 @@ class ParadoxProtocol(BaseProtocol): ...@@ -219,7 +220,22 @@ class ParadoxProtocol(BaseProtocol):
self.log.error("Cannot autoload board mapping for "+str(board)) self.log.error("Cannot autoload board mapping for "+str(board))
def _processEvent(self, event): def _processEvent(self, event):
pass self.flags.asByte = ord(event[0])
alarm = self.flags.alarm
year = (ord(event[1])*100)+ord(event[2])
month = ord(event[3])
day = ord(event[4])
hour = ord(event[5])
minute = ord(event[6])
date = "-".join([str(year), str(month), str(day)])+" "+":".join([str(hour), str(minute)])
event, subevent = EVENTMAP.getEventDescription(ord(event[7]), ord(event[8]))
event = event.strip()
subevent = subevent.strip()
self.log.debug("Event: "+date+" - "+event+": "+subevent+" - In alarm:"+str(alarm))
def _setNames(self, reply, item): def _setNames(self, reply, item):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment