From 06119f7fff2a467c8b6c5911170446f5d7ff583d Mon Sep 17 00:00:00 2001
From: Arnaud Watlet <arnaud.watlet@umons.ac.be>
Date: Tue, 27 Feb 2024 16:36:29 +0100
Subject: [PATCH] Implements test modbus

---
 ohmpi/hardware_components/pwr_dps5005.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ohmpi/hardware_components/pwr_dps5005.py b/ohmpi/hardware_components/pwr_dps5005.py
index 6edfa050..fb975984 100644
--- a/ohmpi/hardware_components/pwr_dps5005.py
+++ b/ohmpi/hardware_components/pwr_dps5005.py
@@ -31,7 +31,7 @@ class Pwr(PwrAbstract):
         super().__init__(**kwargs)
         if not subclass_init:
             self.exec_logger.event(f'{self.model}\tpwr_init\tbegin\t{datetime.datetime.utcnow()}')
-        assert isinstance(self.connection, Instrument)
+
         self._voltage = kwargs['voltage']
         self._current_max = kwargs['current_max']
         self._voltage_max = kwargs['voltage_max']
@@ -39,6 +39,7 @@ class Pwr(PwrAbstract):
         self._current_max_tolerance = kwargs['current_max_tolerance']
         self._pwr_state = 'off'
         if self.connect:
+            assert isinstance(self.connection, Instrument)
             self.pwr_state = self._pwr_state
             self.voltage_default(self._voltage)
             self.current_max_default(self._current_max)
-- 
GitLab