fix(eiger): expose auto_reinitialize as a device attribute

The device server applies deviceConfig entries via update_config, which rejects keys
that are not attributes of the device ("Unknown config parameter"). A constructor
argument alone is therefore not enough to set auto_reinitialize from the config.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAEkW1wjZszVKkhQrD8Ad5
This commit is contained in:
x12sa
2026-10-05 22:39:01 +02:00
co-authored by Claude Sonnet 5.5
parent 1f795c399e
commit bb6bd111d0
2 changed files with 21 additions and 0 deletions
+12
View File
@@ -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:
+9
View File
@@ -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