Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
82b5bf20
Commit
82b5bf20
authored
Mar 15, 2021
by
oroulet
Committed by
oroulet
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix default QualifiedName value
parent
398a45c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
asyncua/ua/uatypes.py
asyncua/ua/uatypes.py
+2
-2
examples/client_to_prosys.py
examples/client_to_prosys.py
+1
-0
No files found.
asyncua/ua/uatypes.py
View file @
82b5bf20
...
@@ -606,14 +606,14 @@ class QualifiedName:
...
@@ -606,14 +606,14 @@ class QualifiedName:
NamespaceIndex
:
UInt16
=
0
NamespaceIndex
:
UInt16
=
0
Name
:
String
=
""
Name
:
String
=
""
def
__init__
(
self
,
Name
=
"MISSING_NAME"
,
NamespaceIndex
=
0
):
def
__init__
(
self
,
Name
=
None
,
NamespaceIndex
=
0
):
self
.
Name
=
Name
self
.
Name
=
Name
self
.
NamespaceIndex
=
NamespaceIndex
self
.
NamespaceIndex
=
NamespaceIndex
if
isinstance
(
self
.
NamespaceIndex
,
str
)
and
isinstance
(
self
.
Name
,
int
):
if
isinstance
(
self
.
NamespaceIndex
,
str
)
and
isinstance
(
self
.
Name
,
int
):
# originally the order or argument was inversed, try to support it
# originally the order or argument was inversed, try to support it
logger
.
warning
(
"QualifiedName are str, int, while int, str is expected, swithcing"
)
logger
.
warning
(
"QualifiedName are str, int, while int, str is expected, swithcing"
)
if
not
isinstance
(
self
.
NamespaceIndex
,
int
)
or
not
isinstance
(
self
.
Name
,
str
):
if
not
isinstance
(
self
.
NamespaceIndex
,
int
)
or
not
isinstance
(
self
.
Name
,
(
str
,
type
(
None
))
):
raise
ValueError
(
f"QualifiedName constructore args have wrong types,
{
self
}
"
)
raise
ValueError
(
f"QualifiedName constructore args have wrong types,
{
self
}
"
)
def
to_string
(
self
):
def
to_string
(
self
):
...
...
examples/client_to_prosys.py
View file @
82b5bf20
...
@@ -19,6 +19,7 @@ async def main():
...
@@ -19,6 +19,7 @@ async def main():
url
=
"opc.tcp://localhost:53530/OPCUA/SimulationServer/"
url
=
"opc.tcp://localhost:53530/OPCUA/SimulationServer/"
# url = "opc.tcp://olivier:olivierpass@localhost:53530/OPCUA/SimulationServer/"
# url = "opc.tcp://olivier:olivierpass@localhost:53530/OPCUA/SimulationServer/"
async
with
Client
(
url
=
url
)
as
client
:
async
with
Client
(
url
=
url
)
as
client
:
await
client
.
load_data_type_definitions
()
print
(
"Root children are"
,
await
client
.
nodes
.
root
.
get_children
())
print
(
"Root children are"
,
await
client
.
nodes
.
root
.
get_children
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment