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

DOCS-1318: Document DoCommand for Power Sensor #2140

Merged

Conversation

sguequierre
Copy link
Contributor

  • Adds DoCommand for Power Sensor

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Nov 1, 2023
@viambot
Copy link
Member

viambot commented Nov 1, 2023

Overall readability score: 55.43 (🔴 -0.03)

File Readability
_index.md 59.94 (🟢 +1.23)
power-sensor.md 69.05 (🔴 -12.4)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
_index.md 59.94 40.55 7.77 14.2 13.85 6.21
  🟢 +1.23 🟢 +0.61 🟢 +0.33 🟢 +0.2 🟢 +0.06 🟢 +0.06
power-sensor.md 69.05 59.3 8.8 7.8 9.85 8.44
  🔴 -12.4 🔴 -8.46 🔴 -1.5 🔴 -1.4 🔴 -1.69 🔴 -1.25

Averages:

  Readability FRE GF ARI CLI DCRS
Average 55.43 46.98 10.58 13.06 12.1 7.73
  🔴 -0.03 🔴 -0.02 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

Copy link
Contributor

@andf-viam andf-viam left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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!!


# Get the readings provided by the sensor.
readings = await my_sensor.get_readings()
readings = await my_power_sensor.get_readings()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andf-viam Updated!

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@JessamyT
Copy link
Collaborator

JessamyT commented Nov 2, 2023

Please add DoCommand to the API table includes!

@npentrel
Copy link
Collaborator

npentrel commented Nov 3, 2023

Updating this branch to test something. since it seems ready to merge I hope that won't mess up anything :)

@viambot
Copy link
Member

viambot commented Nov 3, 2023

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/2140/public

@sguequierre sguequierre merged commit ff69b54 into viamrobotics:main Nov 3, 2023
@sguequierre sguequierre deleted the DOCS-1318/power_sensor-docommand branch November 3, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants