From 3ae5258a1525e5114cc9a30c017d9bdc8ef27bbc Mon Sep 17 00:00:00 2001 From: x01da Date: Thu, 30 Jul 2026 10:51:25 +0200 Subject: [PATCH] fix(hutch cam): do not override internal ophyd name --- debye_bec/devices/cameras/hutch_cam.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debye_bec/devices/cameras/hutch_cam.py b/debye_bec/devices/cameras/hutch_cam.py index 376845d..6479ed1 100644 --- a/debye_bec/devices/cameras/hutch_cam.py +++ b/debye_bec/devices/cameras/hutch_cam.py @@ -39,7 +39,7 @@ class HutchCam(PSIDeviceBase): super().__init__(name=name, scan_info=scan_info, **kwargs) self.scan_parameters: ScanServerScanInfo = None self.hostname = prefix - self.name = "" + self.camera_name = "" # pylint: disable=E1101 def on_connected(self) -> None: @@ -49,12 +49,14 @@ class HutchCam(PSIDeviceBase): info_url = f"http://{CAM_USERNAME}:{CAM_PASSWORD}@{self.hostname}.psi.ch/-wvhttp-01-/info.cgi?item=c.1.name" response = requests.get(info_url, timeout=5) response.raise_for_status() - self.name = response.content.decode("utf-8").split("c.1.name.utf8:=")[-1].strip().lower() + self.camera_name = ( + response.content.decode("utf-8").split("c.1.name.utf8:=")[-1].strip().lower() + ) def on_stage(self) -> DeviceStatus: """Called while staging the device.""" self.scan_parameters = fetch_scan_info(self.scan_info) - file_path = get_full_path(self.scan_info.msg, name=self.name).removesuffix("h5") + file_path = get_full_path(self.scan_info.msg, name=self.camera_name).removesuffix("h5") thread = threading.Thread( target=self.acquire_and_save_from_video, args=(file_path,), daemon=True