Browse Source

Structural work

pyserial_fix
Scott Petersen 7 years ago
parent
commit
e411d97235
3 changed files with 62 additions and 7 deletions
  1. +7
    -6
      alarmdecoder/messages/lrr/__init__.py
  2. +51
    -0
      alarmdecoder/messages/lrr/events.py
  3. +4
    -1
      alarmdecoder/messages/lrr/message.py

+ 7
- 6
alarmdecoder/messages/lrr/__init__.py View File

@@ -1,8 +1,9 @@
from .message import LRRMessage from .message import LRRMessage
from .events import get_event_description, LRR_EVENT_TYPE, LRR_CID_EVENT, LRR_DSC_EVENT, LRR_ADEMCO_EVENT, LRR_ALARMDECODER_EVENT, \
LRR_UNKNOWN_EVENT, LRR_CID_MAP, LRR_DSC_MAP, LRR_ADEMCO_MAP, LRR_ALARMDECODER_MAP, \
LRR_UNKNOWN_MAP
from .system import LRRSystem
from .events import get_event_description, LRR_EVENT_TYPE, LRR_CID_EVENT, LRR_DSC_EVENT, LRR_ADEMCO_EVENT, \
LRR_ALARMDECODER_EVENT, LRR_UNKNOWN_EVENT, LRR_CID_MAP, LRR_DSC_MAP, LRR_ADEMCO_MAP, \
LRR_ALARMDECODER_MAP, LRR_UNKNOWN_MAP


__all__ = ['LRRMessage', 'get_event_description', 'LRR_EVENT_TYPE', 'LRR_CID_EVENT', 'LRR_DSC_EVENT', 'LRR_ADEMCO_EVENT', 'LRR_ALARMDECODER_EVENT',
'LRR_UNKNOWN_EVENT', 'LRR_CID_MAP', 'LRR_DSC_MAP', 'LRR_ADEMCO_MAP', 'LRR_ALARMDECODER_MAP',
'LRR_UNKNOWN_MAP']
__all__ = ['get_event_description', 'LRRMessage', 'LRR_EVENT_TYPE', 'LRR_CID_EVENT', 'LRR_DSC_EVENT',
'LRR_ADEMCO_EVENT', 'LRR_ALARMDECODER_EVENT', 'LRR_UNKNOWN_EVENT', 'LRR_CID_MAP',
'LRR_DSC_MAP', 'LRR_ADEMCO_MAP', 'LRR_ALARMDECODER_MAP', 'LRR_UNKNOWN_MAP']

+ 51
- 0
alarmdecoder/messages/lrr/events.py View File

@@ -340,6 +340,7 @@ class LRR_CID_EVENT:
OTHER_NO_READ_LOG = 0x999 OTHER_NO_READ_LOG = 0x999




# TODO: Figure out values for 0x0 events.
class LRR_DSC_EVENT: class LRR_DSC_EVENT:
ZONE_EXPANDER_SUPERVISORY_ALARM = 0x0 ZONE_EXPANDER_SUPERVISORY_ALARM = 0x0
ZONE_EXPANDER_SUPERVISORY_RESTORE = 0x0 ZONE_EXPANDER_SUPERVISORY_RESTORE = 0x0
@@ -666,3 +667,53 @@ LRR_TYPE_MAP = {
LRR_EVENT_TYPE.ALARMDECODER: LRR_ALARMDECODER_MAP, LRR_EVENT_TYPE.ALARMDECODER: LRR_ALARMDECODER_MAP,
LRR_EVENT_TYPE.UNKNOWN: LRR_UNKNOWN_MAP, LRR_EVENT_TYPE.UNKNOWN: LRR_UNKNOWN_MAP,
} }

LRR_FIRE_EVENTS = [
LRR_CID_EVENT.FIRE,
LRR_CID_EVENT.FIRE_SMOKE,
LRR_CID_EVENT.FIRE_COMBUSTION,
LRR_CID_EVENT.FIRE_WATER_FLOW,
LRR_CID_EVENT.FIRE_HEAT,
LRR_CID_EVENT.FIRE_PULL_STATION,
LRR_CID_EVENT.FIRE_DUCT,
LRR_CID_EVENT.FIRE_FLAME
]

LRR_POWER_EVENTS = [
LRR_CID_EVENT.TROUBLE_AC_LOSS
]

LRR_BYPASS_EVENTS = [
LRR_CID_EVENT.BYPASS_ZONE,
LRR_CID_EVENT.BYPASS_24HOUR_ZONE,
LRR_CID_EVENT.BYPASS_BURGLARY
]

LRR_BATTERY_EVENTS = [
LRR_CID_EVENT.TROUBLE_LOW_BATTERY
]

LRR_PANIC_EVENTS = [
LRR_CID_EVENT.MEDICAL,
LRR_CID_EVENT.MEDICAL_PENDANT,
LRR_CID_EVENT.MEDICAL_FAIL_TO_REPORT,
LRR_CID_EVENT.PANIC,
LRR_CID_EVENT.PANIC_DURESS,
LRR_CID_EVENT.PANIC_SILENT,
LRR_CID_EVENT.PANIC_AUDIBLE,
LRR_CID_EVENT.PANIC_DURESS_ACCESS_GRANTED,
LRR_CID_EVENT.PANIC_DURESS_EGRESS_GRANTED
]

LRR_ARM_EVENTS = [
LRR_CID_EVENT.OPENCLOSE,
LRR_CID_EVENT.OPENCLOSE_BY_USER,
LRR_CID_EVENT.OPENCLOSE_GROUP,
LRR_CID_EVENT.OPENCLOSE_AUTOMATIC,
LRR_CID_EVENT.OPENCLOSE_CANCEL_BY_USER,
LRR_CID_EVENT.OPENCLOSE_REMOTE_ARMDISARM,
LRR_CID_EVENT.OPENCLOSE_QUICK_ARM,
LRR_CID_EVENT.OPENCLOSE_KEYSWITCH,
LRR_CID_EVENT.OPENCLOSE_ARMED_STAY,
LRR_CID_EVENT.OPENCLOSE_KEYSWITCH_ARMED_STAY
]

+ 4
- 1
alarmdecoder/messages/lrr/message.py View File

@@ -12,6 +12,7 @@ devices.
from .. import BaseMessage from .. import BaseMessage
from ...util import InvalidMessageError from ...util import InvalidMessageError


from .events import LRR_EVENT_TYPE


class LRRMessage(BaseMessage): class LRRMessage(BaseMessage):
""" """
@@ -69,8 +70,10 @@ class LRRMessage(BaseMessage):


event_type_data = self.event_type.split('_') event_type_data = self.event_type.split('_')
self.event_prefix = event_type_data[0] self.event_prefix = event_type_data[0]
if self.event_prefix == 'CID':
self.event_source = LRR_EVENT_TYPE.CID
self.event_status = int(event_type_data[1][0]) self.event_status = int(event_type_data[1][0])
self.event_code = int(event_type_data[1][1:])
self.event_code = int(event_type_data[1][1:], 16)


self.partition = int(self.partition) self.partition = int(self.partition)




Loading…
Cancel
Save