Skip to content

Commit

Permalink
Fixed reading GUID nodes for OPC-UA connector
Browse files Browse the repository at this point in the history
  • Loading branch information
samson0v committed Feb 22, 2024
1 parent f92219c commit 2bebfd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions thingsboard_gateway/connectors/opcua/opcua_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import re
import time
from uuid import UUID
from concurrent.futures import CancelledError, TimeoutError as FuturesTimeoutError
from copy import deepcopy
from random import choice
Expand Down Expand Up @@ -624,6 +625,14 @@ def __search_node(self, current_node, fullpath, search_method=False, result=None
self._log.warning("NODE NOT FOUND - using configuration %s", fullpath)
else:
self._log.debug("Found in %s", node)

# this unnecessary code is added to fix the issue with the to_string method of the NodeId class
# and can be deleted after the fix of the issue in the library
if node.nodeid.NodeIdType == ua.NodeIdType.Guid:
node.nodeid = ua.NodeId(UUID(node.nodeid.Identifier), node.nodeid.NamespaceIndex,
nodeidtype=ua.NodeIdType.Guid)
# --------------------------------------------------------------------------------------------------

result.append(node)
else:
fullpath_pattern = regex.compile(fullpath)
Expand Down

0 comments on commit 2bebfd5

Please sign in to comment.