-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
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.
There was a problem hiding this 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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
These simplify the process of getting the current reading or value of a sensor.