diff --git a/pyad2usb/ad2usb.py b/pyad2usb/ad2usb.py index 3c6fb7d..49db928 100644 --- a/pyad2usb/ad2usb.py +++ b/pyad2usb/ad2usb.py @@ -419,16 +419,16 @@ class AD2USB(object): msg = messages.LRRMessage(data) args = (msg.partition, msg.event_type, msg.event_data) - if msg._event_type == 'ALARM_PANIC': + if msg.event_type == 'ALARM_PANIC': self._panic_status = True self.on_panic(True) - elif msg._event_type == 'CANCEL': + elif msg.event_type == 'CANCEL': if self._panic_status == True: self._panic_status = False self.on_panic(False) - self.on_lrr_message(args) + self.on_lrr_message(msg) return msg diff --git a/pyad2usb/messages.py b/pyad2usb/messages.py index c2df6e0..9245c25 100644 --- a/pyad2usb/messages.py +++ b/pyad2usb/messages.py @@ -227,7 +227,7 @@ class LRRMessage(object): """ String conversion operator. """ - return 'lrr > {0} @ {1} -- {2}'.format() + return 'lrr > {0} @ {1} -- {2}'.format(self.event_data, self.partition, self.event_type) def _parse_message(self, data): """