Skip to content

Commit

Permalink
DOCS-3121: Fix generic service methods (#3657)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Nov 6, 2024
1 parent 245dd95 commit eb15bce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,10 @@ def parse(type, names):
service_class = "Generic"
elif resource == "slam":
service_class = "SLAMClient"
this_method_dict["code_sample"] = 'my_{}_svc_name = {}.get_resource_name("my_{}_svc")\n'.format(resource, service_class ,resource)
if resource == "generic_service":
this_method_dict["code_sample"] = 'my_{}_name = {}.get_resource_name("my_{}")\n'.format(resource, service_class ,resource)
else:
this_method_dict["code_sample"] = 'my_{}_svc_name = {}.get_resource_name("my_{}_svc")\n'.format(resource, service_class ,resource)
else:
if resource == "input_controller":
this_method_dict["code_sample"] = 'my_input_controller_name = Controller.get_resource_name("my_input_controller")\n'
Expand Down
4 changes: 2 additions & 2 deletions static/include/components/apis/generated/board.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ Supported by `viam-micro-server`.
**Example:**

```python {class="line-numbers linkable-line-numbers"}
my_board = Board.from_robot(robot=robot, name="my_board")
my_board = Board.from_robot(robot=machine, name="my_board")

# Get the Analog "my_example_analog_reader".
reader = await my_board.analog_reader_by_name(
Expand Down Expand Up @@ -900,7 +900,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/

- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
- `mode` [(pb.PowerMode)](https://pkg.go.dev/go.viam.com/api/component/board/v1#PowerMode): Options to specify power usage of the board: `boardpb.PowerMode_POWER_MODE_UNSPECIFIED`, `boardpb.PowerMode_POWER_MODE_NORMAL`, and `boardpb.PowerMode_POWER_MODE_OFFLINE_DEEP`.
- `duration` [(\*time.Duration)](https://pkg.go.dev/time#Duration): If provided, the board will exit the given power mode after the specified duration.
- `duration` [(*time.Duration)](https://pkg.go.dev/time#Duration): If provided, the board will exit the given power mode after the specified duration.

**Returns:**

Expand Down
3 changes: 1 addition & 2 deletions static/include/services/apis/generated/generic_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ my_command = {
"someparameter": 52
}

# Can be used with any resource, using the motion service as an example
await service.do_command(command=my_command)
```

Expand Down Expand Up @@ -76,7 +75,7 @@ Get the `ResourceName` for this instance of the generic service with the given n
**Example:**

```python {class="line-numbers linkable-line-numbers"}
my_generic_service_svc_name = Generic.get_resource_name("my_generic_service_svc")
my_generic_service_name = Generic.get_resource_name("my_generic_service")
```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/generic/client/index.html#viam.services.generic.client.GenericClient.get_resource_name).
Expand Down

0 comments on commit eb15bce

Please sign in to comment.