async def process_event(self, namespace, data):
    'Processes an event that has been received either locally or from a plugin.\n\n        Args:\n            namespace (str): Namespace the event was fired in.\n            data: Data associated with the event.\n\n        Returns:\n            None.\n\n        '
    try:
        self.logger.debug('Event type:%s:', data['event_type'])
        self.logger.debug(data['data'])
        if ((self.AD.sched is not None) and (self.AD.sched.realtime is False) and (namespace != 'admin')):
            (await self.AD.sched.kick())
        if (data['event_type'] == 'state_changed'):
            if (('entity_id' in data['data']) and ('new_state' in data['data'])):
                if (data['data']['new_state'] is None):
                    return
                entity_id = data['data']['entity_id']
                self.AD.state.set_state_simple(namespace, entity_id, data['data']['new_state'])
                if ((self.AD.apps is True) and (namespace != 'admin')):
                    (await self.AD.state.process_state_callbacks(namespace, data))
            else:
                self.logger.warning("Malformed 'state_changed' event: %s", data['data'])
                return
        if (data['event_type'] == '__AD_LOG_EVENT'):
            if (await self.has_log_callback(data['data']['app_name'])):
                self.logger.debug('Discarding event for loop avoidance')
                return
            (await self.AD.logging.process_log_callbacks(namespace, data))
        if (self.AD.apps is True):
            (await self.process_event_callbacks(namespace, data))
        if (self.AD.http is not None):
            if (data['event_type'] == 'state_changed'):
                if (data['data']['new_state'] == data['data']['old_state']):
                    return
            if ('ts' in data['data']):
                ts = data['data'].pop('ts')
                mydata = deepcopy(data)
                data['data']['ts'] = ts
            else:
                mydata = deepcopy(data)
            (await self.AD.http.stream_update(namespace, mydata))
    except Exception:
        self.logger.warning(('-' * 60))
        self.logger.warning('Unexpected error during process_event()')
        self.logger.warning(('-' * 60))
        self.logger.warning(traceback.format_exc())
        self.logger.warning(('-' * 60))
Processes an event that has been received either locally or from a plugin.

Args:
    namespace (str): Namespace the event was fired in.
    data: Data associated with the event.

Returns:
    None.
async def process_event(self, namespace, data):
    'Processes an event that has been received either locally or from a plugin.\n\n        Args:\n            namespace (str): Namespace the event was fired in.\n            data: Data associated with the event.\n\n        Returns:\n            None.\n\n        '
    try:
        self.logger.debug('Event type:%s:', data['event_type'])
        self.logger.debug(data['data'])
        if ((self.AD.sched is not None) and (self.AD.sched.realtime is False) and (namespace != 'admin')):
            (await self.AD.sched.kick())
        if (data['event_type'] == 'state_changed'):
            if (('entity_id' in data['data']) and ('new_state' in data['data'])):
                if (data['data']['new_state'] is None):
                    return
                entity_id = data['data']['entity_id']
                self.AD.state.set_state_simple(namespace, entity_id, data['data']['new_state'])
                if ((self.AD.apps is True) and (namespace != 'admin')):
                    (await self.AD.state.process_state_callbacks(namespace, data))
            else:
                self.logger.warning("Malformed 'state_changed' event: %s", data['data'])
                return
        if (data['event_type'] == '__AD_LOG_EVENT'):
            if (await self.has_log_callback(data['data']['app_name'])):
                self.logger.debug('Discarding event for loop avoidance')
                return
            (await self.AD.logging.process_log_callbacks(namespace, data))
        if (self.AD.apps is True):
            (await self.process_event_callbacks(namespace, data))
        if (self.AD.http is not None):
            if (data['event_type'] == 'state_changed'):
                if (data['data']['new_state'] == data['data']['old_state']):
                    return
            if ('ts' in data['data']):
                ts = data['data'].pop('ts')
                mydata = deepcopy(data)
                data['data']['ts'] = ts
            else:
                mydata = deepcopy(data)
            (await self.AD.http.stream_update(namespace, mydata))
    except Exception:
        self.logger.warning(('-' * 60))
        self.logger.warning('Unexpected error during process_event()')
        self.logger.warning(('-' * 60))
        self.logger.warning(traceback.format_exc())
        self.logger.warning(('-' * 60))