From 93c7b8be6caf59a3d7be2d5e53a4d46e3029d058 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 5 Oct 2021 14:23:06 +0000
Subject: [PATCH] L2SS-416: Put configure_for_off after
 configure_for_initialise

---
 devices/devices/opcua_device.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/devices/devices/opcua_device.py b/devices/devices/opcua_device.py
index 4b7cb1449..d95a8426e 100644
--- a/devices/devices/opcua_device.py
+++ b/devices/devices/opcua_device.py
@@ -82,16 +82,6 @@ class opcua_device(hardware_device):
     # 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()
     def configure_for_initialise(self):
         """ user code here. is called when the state is set to INIT """
@@ -113,3 +103,13 @@ class opcua_device(hardware_device):
                 self.warn_stream("error while setting the attribute {} read/write function. {}".format(i, e))
 
         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))
+
-- 
GitLab