From f678ef97fd05daf6a3ee0a3ef730739b67131595 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 7 Dec 2020 11:29:17 +0100
Subject: [PATCH] Allow explicit reinitialisation through Init(), and disabled
 direct On() command.

---
 RCUSCC/RCUSCC/RCUSCC.py | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/RCUSCC/RCUSCC/RCUSCC.py b/RCUSCC/RCUSCC/RCUSCC.py
index fca3532ff..6fd823a82 100644
--- a/RCUSCC/RCUSCC/RCUSCC.py
+++ b/RCUSCC/RCUSCC/RCUSCC.py
@@ -211,6 +211,16 @@ class RCUSCC(Device):
         """Initialises the attributes and properties of the RCUSCC."""
         Device.init_device(self)
 
+        self.Init()
+
+    @command(
+    )
+    @DebugIt()
+    def Init(self):
+        """
+
+        :return:None
+        """
         self.set_state(DevState.INIT)
 
         # Init the dict that contains attribute to OPC-UA MP/CP mappings.
@@ -278,6 +288,14 @@ class RCUSCC(Device):
         # Everything went ok -- go online
         self.On()
 
+    @DebugIt()
+    def On(self):
+        """
+
+        :return:None
+        """
+        self.set_state(DevState.ON)
+
 
     def always_executed_hook(self):
         """Method always executed before any TANGO command is executed."""
@@ -420,16 +438,6 @@ class RCUSCC(Device):
     # Commands
     # --------
 
-    @command(
-    )
-    @DebugIt()
-    def On(self):
-        """
-
-        :return:None
-        """
-        self.set_state(DevState.ON)
-
     @command(
     )
     @DebugIt()
-- 
GitLab