Example #1
0
 def _handle_config_event(self, event):
     session_id = None
     if event.session is not None:
         session_id = int(event.session)
     return core_pb2.ConfigEvent(message_type=event.message_type,
                                 node_id=event.node,
                                 object=event.object,
                                 type=event.type,
                                 captions=event.captions,
                                 bitmap=event.bitmap,
                                 data_values=event.data_values,
                                 possible_values=event.possible_values,
                                 groups=event.groups,
                                 session_id=session_id,
                                 interface=event.interface_number,
                                 network_id=event.network_id,
                                 opaque=event.opaque,
                                 data_types=event.data_types)
Example #2
0
def handle_config_event(event: ConfigData) -> core_pb2.ConfigEvent:
    """
    Handle configuration event when there is configuration event

    :param event: configuration data
    :return: configuration event
    """
    return core_pb2.ConfigEvent(
        message_type=event.message_type,
        node_id=event.node,
        object=event.object,
        type=event.type,
        captions=event.captions,
        bitmap=event.bitmap,
        data_values=event.data_values,
        possible_values=event.possible_values,
        groups=event.groups,
        interface=event.interface_number,
        network_id=event.network_id,
        opaque=event.opaque,
        data_types=event.data_types,
    )
Example #3
0
def handle_config_event(config_data: ConfigData) -> core_pb2.Event:
    """
    Handle configuration event when there is configuration event

    :param config_data: configuration data
    :return: configuration event
    """
    config_event = core_pb2.ConfigEvent(
        message_type=config_data.message_type,
        node_id=config_data.node,
        object=config_data.object,
        type=config_data.type,
        captions=config_data.captions,
        bitmap=config_data.bitmap,
        data_values=config_data.data_values,
        possible_values=config_data.possible_values,
        groups=config_data.groups,
        iface_id=config_data.iface_id,
        network_id=config_data.network_id,
        opaque=config_data.opaque,
        data_types=config_data.data_types,
    )
    return core_pb2.Event(config_event=config_event)