-
Notifications
You must be signed in to change notification settings - Fork 45
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
DOCS-1318: Document DoCommand
for Power Sensor
#2140
DOCS-1318: Document DoCommand
for Power Sensor
#2140
Conversation
sguequierre
commented
Nov 1, 2023
- Adds DoCommand for Power Sensor
Overall readability score: 55.43 (🔴 -0.03)
View detailed metrics🟢 - Shows an increase in readability
Averages:
View metric targets
|
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.
LGTM, just some nits and a question. Thanks!
**Parameters:** | ||
|
||
- `ctx` [(Context)](https://pkg.go.dev/context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. | ||
- `cmd` [(map[string]interface{})](https://go.dev/blog/maps): The command to execute. |
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.
Question: I'm vbad at go, but should this be cmd
--> command
to match usage in the Go example below? If so, I see this elsewhere in the docs (as cmd
) (SLAM for example) as well.
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.
It is named cmd, but the example demonstrates feeding it a mapping with an example command named command! See https://pkg.go.dev/go.viam.com/[email protected]/resource#Resource (which should really be linked to here, updating). Is that still confusing?
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.
No that makes sense! I think the updated link helps clarify also. Thanks much!!
Co-authored-by: andf-viam <[email protected]>
|
||
# Get the readings provided by the sensor. | ||
readings = await my_sensor.get_readings() | ||
readings = await my_power_sensor.get_readings() |
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.
@andf-viam Updated!
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.
LGTM!
Please add DoCommand to the API table includes! |
Updating this branch to test something. since it seems ready to merge I hope that won't mess up anything :) |
You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/2140/public |