Browse Source

Fixed tabs.

pyserial_fix
Scott Petersen 10 years ago
parent
commit
ce58e5554a
1 changed files with 48 additions and 44 deletions
  1. +48
    -44
      alarmdecoder/messages.py

+ 48
- 44
alarmdecoder/messages.py View File

@@ -42,10 +42,14 @@ class BaseMessage(object):
return self.raw return self.raw


def dict(self, **kwargs): def dict(self, **kwargs):
"""
Dictionary representation.
"""
return dict(time=self.timestamp, mesg=self.raw, **kwargs)
"""
Dictionary representation.
"""
return dict(
time=self.timestamp,
mesg=self.raw,
**kwargs
)


def __repr__(self): def __repr__(self):
""" """
@@ -166,30 +170,30 @@ class Message(BaseMessage):
Dictionary representation. Dictionary representation.
""" """
return dict( return dict(
time = self.timestamp,
bitfield = self.bitfield,
numeric_code = self.numeric_code,
panel_data = self.panel_data,
mask = self.mask,
ready = self.ready,
armed_away = self.armed_away,
armed_home = self.armed_home,
backlight_on = self.backlight_on,
programming_mode = self.programming_mode,
beeps = self.beeps,
zone_bypassed = self.zone_bypassed,
ac_power = self.ac_power,
chime_on = self.chime_on,
alarm_event_occurred = self.alarm_event_occurred,
alarm_sounding = self.alarm_sounding,
battery_low = self.battery_low,
entry_delay_off = self.entry_delay_off,
fire_alarm = self.fire_alarm,
check_zone = self.check_zone,
perimeter_only = self.perimeter_only,
text = self.text,
cursor_location = self.cursor_location,
**kwargs
time = self.timestamp,
bitfield = self.bitfield,
numeric_code = self.numeric_code,
panel_data = self.panel_data,
mask = self.mask,
ready = self.ready,
armed_away = self.armed_away,
armed_home = self.armed_home,
backlight_on = self.backlight_on,
programming_mode = self.programming_mode,
beeps = self.beeps,
zone_bypassed = self.zone_bypassed,
ac_power = self.ac_power,
chime_on = self.chime_on,
alarm_event_occurred = self.alarm_event_occurred,
alarm_sounding = self.alarm_sounding,
battery_low = self.battery_low,
entry_delay_off = self.entry_delay_off,
fire_alarm = self.fire_alarm,
check_zone = self.check_zone,
perimeter_only = self.perimeter_only,
text = self.text,
cursor_location = self.cursor_location,
**kwargs
) )




@@ -257,11 +261,11 @@ class ExpanderMessage(BaseMessage):
Dictionary representation. Dictionary representation.
""" """
return dict( return dict(
time = self.timestamp,
address = self.address,
channel = self.channel,
value = self.value,
**kwargs
time = self.timestamp,
address = self.address,
channel = self.channel,
value = self.value,
**kwargs
) )




@@ -328,12 +332,12 @@ class RFMessage(BaseMessage):
Dictionary representation. Dictionary representation.
""" """
return dict( return dict(
time = self.timestamp,
serial_number = self.serial_number,
value = self.value,
battery = self.battery,
supervision = self.supervision,
**kwargs
time = self.timestamp,
serial_number = self.serial_number,
value = self.value,
battery = self.battery,
supervision = self.supervision,
**kwargs
) )




@@ -384,9 +388,9 @@ class LRRMessage(BaseMessage):
Dictionary representation. Dictionary representation.
""" """
return dict( return dict(
time = self.timestamp,
event_data = self.event_data,
event_type = self.event_type,
partition = self.partition,
**kwargs
time = self.timestamp,
event_data = self.event_data,
event_type = self.event_type,
partition = self.partition,
**kwargs
) )

Loading…
Cancel
Save