SecopClient.online must be True while activating

as callbacks trigger by updates while activating may check for
online state

+ remove unused imports

Change-Id: I37df839abf6b7225389b803347234a3d0bc8d799
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/33745
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
zolliker 2024-05-22 09:41:03 +02:00
parent 47c5e297d4
commit 63210c9924

View File

@ -30,7 +30,7 @@ from collections import defaultdict
from threading import Event, RLock, current_thread
import frappy.params
from frappy.errors import make_secop_error, SECoPError, WrongTypeError, ProtocolError, ProgrammingError
from frappy.errors import make_secop_error, SECoPError, WrongTypeError
from frappy.datatypes import get_datatype
from frappy.lib import mkthread
from frappy.lib.asynconn import AsynConn, ConnectionClosed
@ -370,9 +370,9 @@ class SecopClient(ProxyClient):
# pylint: disable=unsubscriptable-object
self._init_descriptive_data(self.request(DESCRIPTIONREQUEST)[2])
self.nodename = self.properties.get('equipment_id', self.uri)
self._set_state(True, 'connected')
if self.activate:
self.request(ENABLEEVENTSREQUEST)
self._set_state(True, 'connected')
break
except Exception:
# print(formatExtendedTraceback())