diff --git a/components/button/button.go b/components/button/button.go index 614512f7553..5497319ed8e 100644 --- a/components/button/button.go +++ b/components/button/button.go @@ -31,6 +31,18 @@ func Named(name string) resource.Name { } // A Button represents a physical button. +// For more information, see the [Push 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 diff --git a/components/switch/switch.go b/components/switch/switch.go index 312f747bef0..353a80bf05f 100644 --- a/components/switch/switch.go +++ b/components/switch/switch.go @@ -31,6 +31,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