updated NodeTypes to be used directly
This commit is contained in:
parent
f277e96c9a
commit
5cdfd8d8b9
9 changed files with 12 additions and 16 deletions
|
@ -26,11 +26,7 @@ def add_node_data(node_proto: core_pb2.Node) -> Tuple[NodeTypes, int, NodeOption
|
|||
:return: node type, id, and options
|
||||
"""
|
||||
_id = node_proto.id
|
||||
_type = node_proto.type
|
||||
if _type is None:
|
||||
_type = NodeTypes.DEFAULT.value
|
||||
_type = NodeTypes(_type)
|
||||
|
||||
_type = NodeTypes(node_proto.type)
|
||||
options = NodeOptions(name=node_proto.name, model=node_proto.model)
|
||||
options.icon = node_proto.icon
|
||||
options.opaque = node_proto.opaque
|
||||
|
|
|
@ -17,7 +17,7 @@ def convert_node(node_data):
|
|||
coreapi.CoreNodeTlv,
|
||||
[
|
||||
(NodeTlvs.NUMBER, node_data.id),
|
||||
(NodeTlvs.TYPE, node_data.node_type),
|
||||
(NodeTlvs.TYPE, node_data.node_type.value),
|
||||
(NodeTlvs.NAME, node_data.name),
|
||||
(NodeTlvs.IP_ADDRESS, node_data.ip_address),
|
||||
(NodeTlvs.MAC_ADDRESS, node_data.mac_address),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue