diff --git a/csaxs_bec/devices/jungfraujoch/eiger.py b/csaxs_bec/devices/jungfraujoch/eiger.py index bd31b2e9..d7b183ec 100644 --- a/csaxs_bec/devices/jungfraujoch/eiger.py +++ b/csaxs_bec/devices/jungfraujoch/eiger.py @@ -247,6 +247,18 @@ class Eiger(PSIDeviceBase): return self.preview_image.put(frame) + # NOTE The device server applies every deviceConfig entry through update_config, which only + # accepts keys that exist as attributes of the device. Hence this needs to be a property, + # a constructor argument alone is rejected with 'Unknown config parameter'. + # pylint: disable=missing-function-docstring + @property + def auto_reinitialize(self) -> bool: + return self._auto_reinitialize + + @auto_reinitialize.setter + def auto_reinitialize(self, value: bool) -> None: + self._auto_reinitialize = bool(value) + # pylint: disable=missing-function-docstring @property def detector_distance(self) -> float: diff --git a/tests/tests_devices/test_eiger.py b/tests/tests_devices/test_eiger.py index 2b966dc7..29dfeef3 100644 --- a/tests/tests_devices/test_eiger.py +++ b/tests/tests_devices/test_eiger.py @@ -903,3 +903,12 @@ def test_jfj_client_wait_for_idle_reports_broker_message(): with pytest.raises(JungfrauJochClientError, match="WrongDAQState"): client.wait_for_idle(timeout=1) assert client.wait_for_idle(timeout=1, raise_on_timeout=False) is False + + +def test_eiger_auto_reinitialize_is_a_config_attribute(eiger_1_5m): + """The device server rejects deviceConfig keys that are not attributes of the device.""" + eiger = eiger_1_5m + assert hasattr(eiger, "auto_reinitialize") + assert eiger.auto_reinitialize is False + eiger.auto_reinitialize = True + assert eiger._auto_reinitialize is True