Skip to content

Commit 71c8c61

Browse files
stefan-hudelmaieroroulet
authored andcommitted
Fix issue with running server-events.py example (#383)
The problem was the missing path and using None for Int and Bool properties
1 parent 515bc60 commit 71c8c61

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

examples/server-events.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
sys.path.insert(0, "..")
23
import logging
34

45
try:
@@ -42,8 +43,8 @@ def embed():
4243

4344
# Creating a custom event: Approach 2
4445
custom_etype = server.nodes.base_event_type.add_object_type(2, 'MySecondEvent')
45-
custom_etype.add_property(2, 'MyIntProperty', ua.Variant(None, ua.VariantType.Int32))
46-
custom_etype.add_property(2, 'MyBoolProperty', ua.Variant(None, ua.VariantType.Boolean))
46+
custom_etype.add_property(2, 'MyIntProperty', ua.Variant(0, ua.VariantType.Int32))
47+
custom_etype.add_property(2, 'MyBoolProperty', ua.Variant(True, ua.VariantType.Boolean))
4748

4849
mysecondevgen = server.get_event_generator(custom_etype, myobj)
4950

0 commit comments

Comments
 (0)