MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / write

Method write

examples/server-ua-python-mirror.py:61–70  ·  view source on GitHub ↗
(self, attr=None)

Source from the content-addressed store, hash-verified

59 handle = sub.subscribe_data_change(sub_children)
60
61 def write(self, attr=None):
62 # if a specific attr isn't passed to write, write all OPC UA children
63 if attr is None:
64 for k, node in self.nodes.items():
65 node_class = node.get_node_class()
66 if node_class == ua.NodeClass.Variable:
67 node.set_value(getattr(self, k))
68 # only update a specific attr
69 else:
70 self.nodes[attr].set_value(getattr(self, attr))
71
72
73class MyObj(UaObject):

Callers 1

Calls 2

get_node_classMethod · 0.80
set_valueMethod · 0.80

Tested by

no test coverage detected