Skip to content
Snippets Groups Projects
Commit 93c7b8be authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-416: Put configure_for_off after configure_for_initialise

parent 1c1e6dc1
No related branches found
No related tags found
1 merge request!143L2SS-416: Added opcua_device to capture common code and behaviour of...
...@@ -82,16 +82,6 @@ class opcua_device(hardware_device): ...@@ -82,16 +82,6 @@ class opcua_device(hardware_device):
# overloaded functions # overloaded functions
# -------- # --------
@log_exceptions()
def configure_for_off(self):
""" user code here. is called when the state is set to OFF """
try:
# disconnect
self.opcua_connection.stop()
except Exception as e:
self.warn_stream("Exception while stopping OPC ua connection in configure_for_off function: {}. Exception ignored".format(e))
@log_exceptions() @log_exceptions()
def configure_for_initialise(self): def configure_for_initialise(self):
""" user code here. is called when the state is set to INIT """ """ user code here. is called when the state is set to INIT """
...@@ -113,3 +103,13 @@ class opcua_device(hardware_device): ...@@ -113,3 +103,13 @@ class opcua_device(hardware_device):
self.warn_stream("error while setting the attribute {} read/write function. {}".format(i, e)) self.warn_stream("error while setting the attribute {} read/write function. {}".format(i, e))
self.opcua_connection.start() self.opcua_connection.start()
@log_exceptions()
def configure_for_off(self):
""" user code here. is called when the state is set to OFF """
try:
# disconnect
self.opcua_connection.stop()
except Exception as e:
self.warn_stream("Exception while stopping OPC ua connection in configure_for_off function: {}. Exception ignored".format(e))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment