diff --git a/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py b/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py index 2570838..7703849 100644 --- a/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py +++ b/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py @@ -39,6 +39,7 @@ class H5ImageReplayProxy(DeviceProxy): @file_source.setter def file_source(self, file_source: str) -> None: + self.config[list(self.config.keys())[0]]["file_source"] = file_source self._file_source = file_source @property @@ -48,6 +49,7 @@ class H5ImageReplayProxy(DeviceProxy): @h5_entry.setter def h5_entry(self, h5_entry: str) -> None: + self.config[list(self.config.keys())[0]]["h5_entry"] = h5_entry self._h5_entry = h5_entry def _update_device_config(self, config: dict) -> None: diff --git a/tests/test_simulation.py b/tests/test_simulation.py index 95b0324..c18d4c3 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -453,6 +453,23 @@ def test_slitproxy(slitproxy_fixture): assert (img[:, edges[1] :] == 0).all() +def test_proxy_config_and_props_stay_in_sync(h5proxy_fixture: tuple[H5ImageReplayProxy, SimCamera]): + h5proxy, cam = h5proxy_fixture + h5proxy._update_device_config( + { + cam.name: { + "signal_name": "image", + "file_source": "test first thing", + "h5_entry": "/entry/data/data", + } + } + ) + h5proxy.file_source = "test different thing" + assert h5proxy.config[cam.name]["file_source"] == h5proxy.file_source + h5proxy.h5_entry = "/entry/data/data_000001" + assert h5proxy.config[cam.name]["h5_entry"] == h5proxy.h5_entry + + def test_cam_stage_h5writer(camera): """Test the H5Writer class""" with (