From c8f3f8408eef0d7e1c01f92d5cf71b32ea059559 Mon Sep 17 00:00:00 2001 From: Shihab Suliman Date: Tue, 16 Dec 2025 16:21:34 +0000 Subject: [PATCH 1/2] chore: set sync_setpoint to True after put --- src/fastcs/transports/epics/pva/_pv_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fastcs/transports/epics/pva/_pv_handlers.py b/src/fastcs/transports/epics/pva/_pv_handlers.py index 06430becb..cf2395faa 100644 --- a/src/fastcs/transports/epics/pva/_pv_handlers.py +++ b/src/fastcs/transports/epics/pva/_pv_handlers.py @@ -47,7 +47,7 @@ async def put(self, pv: SharedPV, op: ServerOperation): cast_value = cast_from_p4p_value(self._attr_w, raw_value) tracer.log_event("PV put", topic=self._attr_w, pv=pv, value=cast_value) - await self._attr_w.put(cast_value) + await self._attr_w.put(cast_value, sync_setpoint=True) op.done() From eceea0eb260503377692e921861097d35f945dd2 Mon Sep 17 00:00:00 2001 From: Shihab Suliman Date: Tue, 16 Dec 2025 16:49:35 +0000 Subject: [PATCH 2/2] refactor: cast value depending on attrW datatype --- src/fastcs/transports/epics/pva/_pv_handlers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fastcs/transports/epics/pva/_pv_handlers.py b/src/fastcs/transports/epics/pva/_pv_handlers.py index cf2395faa..bf0f84ab7 100644 --- a/src/fastcs/transports/epics/pva/_pv_handlers.py +++ b/src/fastcs/transports/epics/pva/_pv_handlers.py @@ -7,7 +7,7 @@ from p4p.server.asyncio import SharedPV from fastcs.attributes import Attribute, AttrR, AttrRW, AttrW -from fastcs.datatypes import Table +from fastcs.datatypes import Enum, Table from fastcs.methods import CommandCallback from fastcs.tracer import Tracer @@ -47,8 +47,12 @@ async def put(self, pv: SharedPV, op: ServerOperation): cast_value = cast_from_p4p_value(self._attr_w, raw_value) tracer.log_event("PV put", topic=self._attr_w, pv=pv, value=cast_value) - await self._attr_w.put(cast_value, sync_setpoint=True) + await self._attr_w.put(cast_value) op.done() + if isinstance(self._attr_w.datatype, Enum): + pv.post(cast_to_p4p_value(self._attr_w, cast_value)) + else: + pv.post(value) class CommandPvHandler: