Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sensor_reading and sensor_value helpers #86

Merged
merged 5 commits into from
Apr 8, 2024
Merged

Conversation

bmerry
Copy link
Contributor

@bmerry bmerry commented Apr 5, 2024

These simplify the process of getting the current reading or value of a sensor.

@coveralls
Copy link

coveralls commented Apr 5, 2024

Coverage Status

coverage: 93.445% (+0.2%) from 93.284%
when pulling 2dc09a0 on sensor_reading
into ac56aee on master.

bmerry added a commit to ska-sa/katgpucbf that referenced this pull request Apr 5, 2024
Replace them with aiokatcp.Client.sensor_value. This is not yet
released; see ska-sa/aiokatcp#86.

Closes NGC-1035
aiokatcp and katcp-python support an extension to ?sensor-value that
allows a regex to be passed (between slashes) and returns all matching
sensors. If such a regex is passed to `sensor_reading`, the return would
not contain exactly one sensor value as expected. Add a check that the
return contains exactly one inform.
Copy link
Contributor

@james-smith-za james-smith-za left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy. One nit-pick, feel free to merge after addressing.

src/aiokatcp/client.py Outdated Show resolved Hide resolved
bmerry and others added 2 commits April 8, 2024 12:22
Co-authored-by: James Smith <james-smith-za@users.noreply.github.com>
@@ -224,7 +224,7 @@ async def handle_message(self, conn: connection.Connection, msg: core.Message) -
elif msg.mtype == core.Message.Type.INFORM:
req.informs.append(msg)
else:
self.logger.warning("Unknown message type %s", msg.mtype) # pragma: no cover
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this one looks as though we can probably explicitly test for it but it would be a bit contrived.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it's possible, but also outside the scope of this PR.

@bmerry bmerry merged commit d673791 into master Apr 8, 2024
21 of 22 checks passed
@bmerry bmerry deleted the sensor_reading branch April 8, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants