Skip to content

Document switch position labels #4425

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

promptless[bot]
Copy link
Contributor

@promptless promptless bot commented Jun 30, 2025

Based on PR "Add labels to switch" from viamrobotics/rdk, update the documentation to reflect the RDK implementation of switch position labels functionality that enhances the GetNumberOfPositions method to return human-readable labels for switch positions in addition to the numeric count.

Key Enhancement:

  • The GetNumberOfPositions method now returns both the number of positions AND an array of string labels for those positions
  • This allows users to provide meaningful names for switch positions (e.g., "Off", "Low", "Medium", "High") instead of just numeric positions
  • Improves usability by making switch positions more intuitive and self-documenting

RDK Implementation Changes:

  • GetNumberOfPositionsResponse now includes a repeated string labels field
  • The labels array corresponds to the switch positions, providing human-readable names
  • Fake switch model now supports a labels configuration field for custom position names
  • Default labels are "Position 1", "Position 2", etc. if not specified
  • This is an additive change that maintains backward compatibility

Documentation Updates Needed:

  • Update the GetNumberOfPositions method documentation to describe the new labels return value
  • Add comprehensive examples showing how to access and use the position labels across Python, Go, and TypeScript SDKs
  • Create fake switch model documentation with labels configuration examples
  • Update the switch API overview and component documentation to mention the labeling capability
  • Update the API method table to reflect the enhanced functionality
  • Add changelog entry documenting this enhancement

This enhancement makes switch components more user-friendly by allowing developers to work with meaningful position names rather than just numeric indices, improving code readability and reducing the need for manual position-to-name mapping in user applications.

Trigger Events


If you want Promptless to make further changes on this PR, feel free to leave a comment tagging Promptless (It won't show up in the user drop down but Promptless will get it!)

@CLAassistant
Copy link

CLAassistant commented Jun 30, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ npentrel
❌ promptless[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@viambot
Copy link
Member

viambot commented Jun 30, 2025

👋 Thanks for contributing! A reviewer will look at it on the next working day!

Copy link
Contributor Author

promptless bot commented Jun 30, 2025

Just a reminder: If you'd like me to act on any feedback you have via Github comments, just type @Promptless in your suggestion and I'll get right on it! (I won't show up in the user dropdown, but I'll process any request that has @Promptless in the comment body.)

Copy link

netlify bot commented Jun 30, 2025

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 820d725
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/6863fe8ddbb94b000813328e
😎 Deploy Preview https://deploy-preview-4425--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 40 (🔴 down 11 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@npentrel npentrel marked this pull request as draft July 2, 2025 13:40
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