Skip to content

Commit 7ddd7d2

Browse files
authored
Fix alarm status on Command PVs (#265)
Add ZNAM, ONAM and initial_value to underlying bool record
1 parent a8f1cdb commit 7ddd7d2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/fastcs/transport/epics/ca/ioc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ async def wrapped_method(_: Any):
269269
f"{pv_prefix}:{pv_name}",
270270
on_update=wrapped_method,
271271
blocking=True,
272+
initial_value=0,
273+
ZNAM="Idle",
274+
ONAM="Active",
272275
)
273276

274277
_add_attr_pvi_info(record, pv_prefix, attr_name, "x")

tests/transport/epics/ca/test_softioc.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ def test_ioc(mocker: MockerFixture, epics_controller_api: ControllerAPI):
316316
),
317317
)
318318
ioc_builder.Action.assert_any_call(
319-
f"{DEVICE}:Go", on_update=mocker.ANY, blocking=True
319+
f"{DEVICE}:Go",
320+
on_update=mocker.ANY,
321+
blocking=True,
322+
initial_value=0,
323+
ZNAM="Idle",
324+
ONAM="Active",
320325
)
321326

322327
# Check info tags are added
@@ -504,7 +509,12 @@ def test_long_pv_names_discarded(mocker: MockerFixture):
504509

505510
short_command_pv_name = "command_short_name".title().replace("_", "")
506511
ioc_builder.Action.assert_called_once_with(
507-
f"{DEVICE}:{short_command_pv_name}", on_update=mocker.ANY, blocking=True
512+
f"{DEVICE}:{short_command_pv_name}",
513+
on_update=mocker.ANY,
514+
blocking=True,
515+
initial_value=0,
516+
ZNAM="Idle",
517+
ONAM="Active",
508518
)
509519
with pytest.raises(AssertionError):
510520
long_command_pv_name = long_command_name.title().replace("_", "")

0 commit comments

Comments
 (0)