Skip to content

Commit 2153173

Browse files
evvaaaaGDYendell
authored andcommitted
Changed from builder.aOut to builder.Action for commands
`builder.Action` is a wrapper to a `boolOut` with `always_update=True`. This is how PandaBlocks-ioc does it and will probably work with ophyd-async.
1 parent baebfaa commit 2153173

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/fastcs/transport/epics/ioc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,8 @@ def _create_and_link_command_pv(
355355
async def wrapped_method(_: Any):
356356
await method()
357357

358-
record = builder.aOut(
358+
record = builder.Action(
359359
f"{pv_prefix}:{pv_name}",
360-
initial_value=0,
361-
always_update=True,
362360
on_update=wrapped_method,
363361
)
364362

tests/transport/epics/test_ioc.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,7 @@ def test_ioc(mocker: MockerFixture, controller: Controller):
269269
always_update=True,
270270
on_update=mocker.ANY,
271271
)
272-
builder.aOut.assert_any_call(
273-
f"{DEVICE}:Go", initial_value=0, always_update=True, on_update=mocker.ANY
274-
)
272+
builder.Action.assert_any_call(f"{DEVICE}:Go", on_update=mocker.ANY)
275273

276274
# Check info tags are added
277275
add_pvi_info.assert_called_once_with(f"{DEVICE}:PVI")
@@ -443,10 +441,8 @@ def test_long_pv_names_discarded(mocker: MockerFixture):
443441
assert not getattr(long_name_controller, long_command_name).fastcs_method.enabled
444442

445443
short_command_pv_name = "command_short_name".title().replace("_", "")
446-
builder.aOut.assert_called_once_with(
444+
builder.Action.assert_called_once_with(
447445
f"{DEVICE}:{short_command_pv_name}",
448-
initial_value=0,
449-
always_update=True,
450446
on_update=mocker.ANY,
451447
)
452448
with pytest.raises(AssertionError):

0 commit comments

Comments
 (0)