Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/button/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ func Named(name string) resource.Name {
}

// A Button represents a physical button.
// For more information, see the [Button component docs].
//
// Push example:
//
// myButton, err := switch.FromRobot(machine, "my_button")
//
// err := myButton.Push(context.Background(), nil)
//
// For more information, see the [Push method docs].
//
// [Button component docs]: https://docs.viam.com/dev/reference/apis/components/button/
// [Push method docs]: https://docs.viam.com/dev/reference/apis/components/button/#push
type Button interface {
resource.Resource

Expand Down
30 changes: 30 additions & 0 deletions components/switch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,36 @@ func Named(name string) resource.Name {
}

// A Switch represents a physical multi-position switch.
// For more information, see the [Switch component docs].
//
// SetPosition example:
//
// mySwitch, err := switch.FromRobot(machine, "my_switch")
//
// err := mySwitch.SetPosition(context.Background(), 0 , nil)
//
// For more information, see the [SetPosition method docs].
//
// GetPosition example:
//
// mySwitch, err := switch.FromRobot(machine, "my_switch")
//
// position, err := mySwitch.GetPosition(context.Background(), nil)
//
// For more information, see the [GetPosition method docs].
//
// GetNumberOfPositions example:
//
// mySwitch, err := switch.FromRobot(machine, "my_switch")
//
// positions, err := mySwitch.GetNumberOfPositions(context.Background(), nil)
//
// For more information, see the [GetNumberOfPositions method docs].
//
// [Switch component docs]: https://docs.viam.com/dev/reference/apis/components/switch/
// [SetPosition method docs]: https://docs.viam.com/dev/reference/apis/components/switch/#setposition
// [GetPosition method docs]: https://docs.viam.com/dev/reference/apis/components/switch/#getposition
// [GetNumberOfPositions method docs]: https://docs.viam.com/dev/reference/apis/components/switch/#getnumberofpositions
type Switch interface {
resource.Resource

Expand Down
Loading