diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index e16ff60..f377e57 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -13,7 +13,7 @@ from .event import event from .util import InvalidMessageError from .messages import Message, ExpanderMessage, RFMessage, LRRMessage from .zonetracking import Zonetracker -from .panels import MODES, ADEMCO, DSC +from .panels import PANEL_TYPES, ADEMCO, DSC class AlarmDecoder(object): @@ -235,7 +235,7 @@ class AlarmDecoder(object): ''.join(['Y' if r else 'N' for r in self.emulate_relay]))) config_entries.append(('LRR', 'Y' if self.emulate_lrr else 'N')) config_entries.append(('DEDUPLICATE', 'Y' if self.deduplicate else 'N')) - config_entries.append(('MODE', MODES.keys()[MODES.values().index(self.mode)])) + config_entries.append(('MODE', PANEL_TYPES.keys()[PANEL_TYPES.values().index(self.mode)])) config_string = '&'.join(['='.join(t) for t in config_entries]) @@ -431,7 +431,7 @@ class AlarmDecoder(object): elif key == 'DEDUPLICATE': self.deduplicate = (val == 'Y') elif key == 'MODE': - self.mode = MODES[val] + self.mode = PANEL_TYPES[val] self.on_config_received() diff --git a/alarmdecoder/messages.py b/alarmdecoder/messages.py index 4e5b5c5..de1d491 100644 --- a/alarmdecoder/messages.py +++ b/alarmdecoder/messages.py @@ -16,7 +16,7 @@ import re import datetime from .util import InvalidMessageError -from .panels import MODES, ADEMCO, DSC +from .panels import PANEL_TYPES, ADEMCO, DSC class BaseMessage(object): @@ -163,8 +163,8 @@ class Message(BaseMessage): self.check_zone = is_bit_set(15) self.perimeter_only = is_bit_set(16) self.system_fault = is_bit_set(17) - if self.bitfield[18] in MODES.keys(): - self.panel_type = MODES[self.bitfield[18]] + if self.bitfield[18] in PANEL_TYPES.keys(): + self.panel_type = PANEL_TYPES[self.bitfield[18]] # pos 20-21 - Unused. self.text = alpha.strip('"') diff --git a/alarmdecoder/panels.py b/alarmdecoder/panels.py index 34a9b12..c1f981a 100644 --- a/alarmdecoder/panels.py +++ b/alarmdecoder/panels.py @@ -7,7 +7,7 @@ Representations of Panels and their templates. ADEMCO = 0 DSC = 1 -MODES = { +PANEL_TYPES = { 'A': ADEMCO, 'D': DSC, }