(self, attr=None)
| 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 | |
| 73 | class MyObj(UaObject): |
no test coverage detected