Skip to content

Commit

Permalink
Fix handling of string[] values
Browse files Browse the repository at this point in the history
  • Loading branch information
jsouter committed Dec 11, 2024
1 parent 8a2291b commit 1f49eb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fastcs_eiger/eiger_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ async def put(
async def update(self, controller: "EigerSubsystemController", attr: AttrR) -> None:
try:
response = await controller.connection.get(self.uri)
await attr.set(response["value"])
value = response["value"]
if isinstance(value, list) and all(
isinstance(s, str) for s in value
): # error is a list of strings
value = ", ".join(value)

Check warning on line 96 in src/fastcs_eiger/eiger_controller.py

View check run for this annotation

Codecov / codecov/patch

src/fastcs_eiger/eiger_controller.py#L96

Added line #L96 was not covered by tests
await attr.set(value)
except Exception as e:
print(f"Failed to get {self.uri}:\n{e.__class__.__name__} {e}")

Expand Down

0 comments on commit 1f49eb9

Please sign in to comment.