Browse Source

Simplified the arguments for very basic events.

pyserial_fix
Scott Petersen 11 years ago
parent
commit
0c525ada82
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      alarmdecoder/decoder.py

+ 6
- 5
alarmdecoder/decoder.py View File

@@ -566,21 +566,22 @@ class AlarmDecoder(object):
""" """
self.get_config() self.get_config()


self.on_open(args, kwargs)
self.on_open()


def _on_close(self, sender, *args, **kwargs): def _on_close(self, sender, *args, **kwargs):
""" """
Internal handler for closing the device. Internal handler for closing the device.
""" """
self.on_close(args, kwargs)
self.on_close()


def _on_read(self, sender, *args, **kwargs): def _on_read(self, sender, *args, **kwargs):
""" """
Internal handler for reading from the device. Internal handler for reading from the device.
""" """
self.on_read(args, kwargs)
data = kwargs.get('data', None)
self.on_read(data=data)


msg = self._handle_message(kwargs.get('data', None))
msg = self._handle_message(data)
if msg: if msg:
self.on_message(message=msg) self.on_message(message=msg)


@@ -588,7 +589,7 @@ class AlarmDecoder(object):
""" """
Internal handler for writing to the device. Internal handler for writing to the device.
""" """
self.on_write(args, kwargs)
self.on_write(data=kwargs.get('data', None))


def _on_zone_fault(self, sender, *args, **kwargs): def _on_zone_fault(self, sender, *args, **kwargs):
""" """


Loading…
Cancel
Save