opc_ua/client.py
branchwxPython4
changeset 3643 c6068b674b30
parent 3612 428fb2472f43
child 3652 b5c6bb72bfc9
--- a/opc_ua/client.py	Fri Oct 21 18:33:06 2022 +0200
+++ b/opc_ua/client.py	Tue Oct 25 18:51:45 2022 +0200
@@ -67,6 +67,7 @@
                       </xsd:sequence>
                       <xsd:attribute name="Certificate" type="xsd:string" use="optional" default="certificate.pem"/>
                       <xsd:attribute name="PrivateKey" type="xsd:string" use="optional" default="private_key.pem"/>
+                      <xsd:attribute name="ApplicationUri" type="xsd:string" use="optional"/>
                     </xsd:complexType>
                   </xsd:element>
                   <xsd:element name="UserPassword">
@@ -114,6 +115,9 @@
                 # cryptomaterial is expected to be in project's user provide file directory
                 if name in ["Certificate","PrivateKey"]:
                     value = os.path.join(self.GetCTRoot()._getProjectFilesPath(), value)
+                # ApplicationUri defaults to URI if not set
+                if name == "ApplicationUri" and not value:
+                        value = res["URI"]
                 res[name] = value
 
         return res