Joseph Doherty
1ad0be8276
Point the Python client at the StreamAlarms alarm feed
...
Regenerate the Python protobuf stubs and replace query_active_alarms
with stream_alarms, an AsyncIterator over AlarmFeedMessage served by
the gateway's central alarm monitor (snapshot, snapshot_complete, then
live transitions). Drops session_id from the acknowledge surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-21 16:45:53 -04:00
Joseph Doherty
168bb9a39a
clients/python: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.3)
...
Eighth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface
on the Python async SDK. Depends on PR E.1 (regen, merged).
- GatewayClient.acknowledge_alarm — async unary call routed through
the existing _unary helper. ensure_protocol_success raises typed
gateway errors for non-OK protocol statuses; map_rpc_error wraps
RpcError → MxGatewayAuthenticationError /
MxGatewayAuthorizationError on Unauthenticated /
PermissionDenied responses.
- GatewayClient.query_active_alarms — async iterator over
ActiveAlarmSnapshot. Mirrors stream_events_raw's cancel-on-close
pattern via a dedicated _canceling_active_alarms_iterator (typed
for ActiveAlarmSnapshot).
Tests:
- 6 new tests in test_alarms.py — request shape, Unauthenticated +
PermissionDenied mapping, snapshot streaming, filter prefix
passthrough, cancel-on-aclose semantics.
- Full Python test suite: 39 passed (was 33; 6 new).
CLI verb (alarms subscribe / acknowledge / query-active) deferred —
the SDK surface is what lmxopcua consumes; CLI follow-up shares the
JSON output shape with E.2's .NET CLI for cross-language tooling.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-04-30 16:50:31 -04:00