Retrieves the boolean status of an LRR message.

        :param message: LRR message object
        :type message: :py:class:`~alarmdecoder.messages.LRRMessage`

        :returns: Boolean indicating whether the event was triggered or restored.
15208
def _get_event_status(self, message):
        
        status = None

        if message.event_status == LRR_EVENT_STATUS.TRIGGER:
            status = True
        elif message.event_status == LRR_EVENT_STATUS.RESTORE:
            status = False

        return status
390297
def messageReceived(self, message):
        
        if len(message) == 2:
            # compatibility receiving of tag as first part
            # of multi-part message
            self.gotMessage(message[1], message[0])
        else:
            self.gotMessage(*reversed(message[0].split(b'\0', 1)))
490561
def receive_message(self, message, data):
        
        if data[MESSAGE_TYPE] == TYPE_STATUS:
            self._process_status(data.get("data"))
            return True

        return False
564531
def _onMessage(self, ws, message):
        
        try:
            data = json.loads(message)['NotificationContainer']
            log.debug('Alert: %s %s %s', *data)
            if self._callback:
                self._callback(data)
        except Exception as err:  # pragma: no cover
            log.error('AlertListener Msg Error: %s', err)
1157484
def get_message(self):
        
        if not self._message:
            return None
        self._populate_message_attributes(self._message)
        return self._message
682948
def handle_lrr_message(sender, message):
    
    print(sender, message.partition, message.event_type, message.event_data)
171879
def message(self, message, thread_id=None):
        
        return_value = helpers.Messager(self._session).send(
            self.username, message, self.authcode, thread_id
        )
        self.refresh(reload=False)
        return return_value
815390
def on_ok(self, sender):
        
        logger.debug("in on_ok with sender %s" % sender)

        if self.all_ok:
            if self.finalized:
                return AttrDict(returncode=0, message="Work has been already finalized")
            else:
                # Set finalized here, because on_all_ok might change it (e.g. Relax + EOS in a single work)
                self.finalized = True
                try:
                    results = AttrDict(**self.on_all_ok())
                except Exception as exc:
                    self.history.critical("on_all_ok raises %s" % str(exc))
                    self.finalized = False
                    raise

                # Signal to possible observers that the `Work` reached S_OK
                self.history.info("Work %s is finalized and broadcasts signal S_OK" % str(self))
                if self._finalized:
                    self.send_signal(self.S_OK)

                return results

        return AttrDict(returncode=1, message="Not all tasks are OK!")
1274490
async def get_message(self, ignore_subscribe_messages=False, timeout=0):
        
        response = await self.parse_response(block=False, timeout=timeout)
        if response:
            return self.handle_message(response, ignore_subscribe_messages)
        return None
1108287
def get_statusmsg(self) -> str:
        
        if self._last_status is None:
            return self._last_status
        return self._last_status.decode()
944160
def get_can_status_message(can_status):
        
        status_msgs = {
            CanStatus.CANERR_TXMSGLOST: "Transmit message lost",
            CanStatus.CANERR_MEMTEST: "Memory test failed",
            CanStatus.CANERR_REGTEST: "Register test failed",
            CanStatus.CANERR_QXMTFULL: "Transmit queue is full",
            CanStatus.CANERR_QOVERRUN: "Receive queue overrun",
            CanStatus.CANERR_QRCVEMPTY: "Receive queue is empty",
            CanStatus.CANERR_BUSOFF: "Bus Off",
            CanStatus.CANERR_BUSHEAVY: "Error Passive",
            CanStatus.CANERR_BUSLIGHT: "Warning Limit",
            CanStatus.CANERR_OVERRUN: "Rx-buffer is full",
            CanStatus.CANERR_XMTFULL: "Tx-buffer is full",
        }
        return "OK" if can_status == CanStatus.CANERR_OK \
            else ", ".join(msg for status, msg in status_msgs.items() if can_status & status)
1043866
def message_received(self, message):
        """"""
        # If the message identifer is outstanding, then someone is
        # waiting for the respone so we save it here
        identifier = message.identifier or 'type_' + str(message.type)
        if identifier in self._outstanding:
            outstanding = OutstandingMessage(
                self._outstanding[identifier].semaphore, message)
            self._outstanding[identifier] = outstanding
            self._outstanding[identifier].semaphore.release()
        else:
            asyncio.ensure_future(self._dispatch(message), loop=self.loop)
168846
def status(logger):
    
    aborted = logger.get_aborted_actions()
    succeeded = logger.get_succeeded_actions()
    total = aborted + succeeded
    if total == 0:
        return 'No actions done'
    elif total == 1 and succeeded == 1:
        return 'One action done (succeeded)'
    elif total == 1 and succeeded == 0:
        return 'One action done (failed)'
    elif total == succeeded:
        return '%d actions total (all succeeded)' % total
    elif succeeded == 0:
        return '%d actions total (all failed)' % total
    else:
        msg = '%d actions total (%d failed, %d succeeded)'
        return msg % (total, aborted, succeeded)
384058
def on_message(self, message):
        
        self._record_activity()
        if hasattr(self, 'ws'):
            self.ws.write_message(message, binary=isinstance(message, bytes))
309827
def is_message_handler(type_, from_, cb):
    
    import aioxmpp.dispatcher
    return aioxmpp.dispatcher.is_message_handler(type_, from_, cb)
1300753
def monitor(self, message, *args, **kws):
    
    if self.isEnabledFor(MON):
        # Yes, logger takes its '*args' as 'args'.
        self._log(MON, message, args, **kws)
252521
async def on_raw_005(self, message):
        
        isupport = {}

        # Parse response.
        # Strip target (first argument) and 'are supported by this server' (last argument).
        for feature in message.params[1:-1]:
            if feature.startswith(FEATURE_DISABLED_PREFIX):
                value = False
            elif '=' in feature:
                feature, value = feature.split('=', 1)
            else:
                value = True
            isupport[feature.upper()] = value

        # Update internal dict first.
        self._isupport.update(isupport)

        # And have callbacks update other internals.
        for entry, value in isupport.items():
            if value != False:
                # A value of True technically means there was no value supplied; correct this for callbacks.
                if value == True:
                    value = None

                method = 'on_isupport_' + pydle.protocol.identifierify(entry)
                if hasattr(self, method):
                    await getattr(self, method)(value)