From d2539918b296559e1d684344e179775a2423daa9 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 4 Jun 2024 10:43:04 +0200 Subject: [PATCH] fix(spiral_progress_bar): Endpoint is always stored as a string in the RingConnection Config --- bec_widgets/widgets/spiral_progress_bar/ring.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bec_widgets/widgets/spiral_progress_bar/ring.py b/bec_widgets/widgets/spiral_progress_bar/ring.py index b1f6b538..eef64023 100644 --- a/bec_widgets/widgets/spiral_progress_bar/ring.py +++ b/bec_widgets/widgets/spiral_progress_bar/ring.py @@ -17,16 +17,16 @@ class RingConnections(BaseModel): @field_validator("endpoint") def validate_endpoint(cls, v, values): slot = values.data["slot"] - endpoint = v.endpoint if isinstance(v, EndpointInfo) else v + v = v.endpoint if isinstance(v, EndpointInfo) else v if slot == "on_scan_progress": - if endpoint != "scans/scan_progress": + if v != "scans/scan_progress": raise PydanticCustomError( "unsupported endpoint", "For slot 'on_scan_progress', endpoint must be MessageEndpoint.scan_progress or 'scans/scan_progress'.", {"wrong_value": v}, ) elif slot == "on_device_readback": - if not endpoint.startswith("internal/devices/readback/"): + if not v.startswith("internal/devices/readback/"): raise PydanticCustomError( "unsupported endpoint", "For slot 'on_device_readback', endpoint must be MessageEndpoint.device_readback(device) or 'internal/devices/readback/{device}'.",