Skip to content

Commit 4115ae8

Browse files
authored
DOCS-3888: Add Switch and Button micro-rdk support (#4246)
1 parent fec8e7a commit 4115ae8

File tree

9 files changed

+150
-91
lines changed

9 files changed

+150
-91
lines changed

.github/workflows/sdk_protos_map.csv

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ board,GetResourceName,No,get_resource_name,,getResourceName,
5858
board,Close,No,close,Close,,
5959

6060
## Button
61-
button,Push,No,push,Push,,push
62-
button,DoCommand,No,,DoCommand,,doCommand
63-
button,Close,No,,Close,,
61+
button,Push,Yes,push,Push,,push
62+
button,DoCommand,Yes,do_command,DoCommand,,doCommand
63+
button,Close,No,close,Close,,
6464

6565
## Camera
6666
camera,GetImage,,get_image,Image,image,getImage
@@ -213,10 +213,10 @@ servo,GetResourceName,No,get_resource_name,,getResourceName,
213213
servo,Close,No,close,Close,,
214214

215215
## Switch
216-
switch,SetPosition,No,set_position,SetPosition,,setPosition
217-
switch,GetPosition,No,get_position,GetPosition,,getPosition
218-
switch,GetNumberOfPositions,No,get_number_of_positions,GetNumberOfPositions,,getNumberOfPositions
219-
switch,DoCommand,No,do_command,DoCommand,,doCommand
216+
switch,SetPosition,Yes,set_position,SetPosition,,setPosition
217+
switch,GetPosition,Yes,get_position,GetPosition,,getPosition
218+
switch,GetNumberOfPositions,Yes,get_number_of_positions,GetNumberOfPositions,,getNumberOfPositions
219+
switch,DoCommand,Yes,do_command,DoCommand,,doCommand
220220
switch,Close,No,close,Close,,
221221

222222
## Base Remote Control

static/include/app/apis/generated/app.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3061,8 +3061,8 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
30613061

30623062
**Parameters:**
30633063

3064-
- `oldAuthorization` ([Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required)
3065-
- `newAuthorization` ([Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required)
3064+
- `oldAuthorization` ([Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The existing authorization.
3065+
- `newAuthorization` ([Authorization](https://ts.viam.dev/classes/appApi.Authorization.html)) (required): The new authorization to change to.
30663066

30673067
**Returns:**
30683068

static/include/app/apis/generated/data_sync.md

+47-42
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
5555
- `binaryData` (Uint8Array) (required): The data to be uploaded, represented in bytes.
5656
- `partId` (string) (required): The part ID of the component used to capture the data.
5757
- `componentType` (string) (required): The type of the component used to capture the data
58-
(for example, "movementSensor").
58+
(for example, "movementSensor").
5959
- `componentName` (string) (required): The name of the component used to capture the data.
6060
- `methodName` (string) (required): The name of the method used to capture the data.
6161
- `fileExtension` (string) (required): The file extension of binary data including the
62-
period, for example .jpg, .png, or .pcd. The backend will route the binary to its
63-
corresponding mime type based on this extension. Files with a .jpeg,
64-
.jpg, or .png extension will be saved to the images tab.
62+
period, for example .jpg, .png, or .pcd. The backend will route the
63+
binary to its corresponding mime type based on this extension. Files with
64+
a .jpeg, .jpg, or .png extension will be saved to the images tab.
6565
- `dataRequestTimes` (Date) (required): Tuple containing Date objects denoting the times
66-
this data was requested[0] by the robot and received[1] from the
67-
appropriate sensor.
66+
this data was requested[0] by the robot and received[1] from the
67+
appropriate sensor.
6868
- `tags` (string) (optional): The list of tags to allow for tag-based filtering when
69-
retrieving data.
69+
retrieving data.
7070

7171
**Returns:**
7272

@@ -77,12 +77,12 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
7777
```ts {class="line-numbers linkable-line-numbers"}
7878
const binaryDataId = await dataClient.binaryDataCaptureUpload(
7979
binaryData,
80-
"123abc45-1234-5678-90ab-cdef12345678",
81-
"rdk:component:camera",
82-
"my-camera",
83-
"ReadImage",
84-
".jpg",
85-
[new Date("2025-03-19"), new Date("2025-03-19")],
80+
'123abc45-1234-5678-90ab-cdef12345678',
81+
'rdk:component:camera',
82+
'my-camera',
83+
'ReadImage',
84+
'.jpg',
85+
[new Date('2025-03-19'), new Date('2025-03-19')]
8686
);
8787
```
8888

@@ -93,19 +93,19 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
9393

9494
**Parameters:**
9595

96-
- `binaryData` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[int](https://api.flutter.dev/flutter/dart-core/int-class.html)> (required)
96+
- `binaryData` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[int](https://api.flutter.dev/flutter/dart-core/int-class.html)\> (required)
9797
- `partId` [String](https://api.flutter.dev/flutter/dart-core/String-class.html) (required)
9898
- `fileExtension` [String](https://api.flutter.dev/flutter/dart-core/String-class.html) (required)
9999
- `componentType` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
100100
- `componentName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
101101
- `methodName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
102-
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any>? (optional)
102+
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any\>? (optional)
103103
- `dataRequestTimes` ([DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html), [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html))? (optional)
104-
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> (optional)
104+
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\> (optional)
105105

106106
**Returns:**
107107

108-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)>
108+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\>
109109

110110
**Example:**
111111

@@ -203,19 +203,19 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
203203
**Parameters:**
204204

205205
- `tabularData` (Record) (required): The list of data to be uploaded, represented tabularly
206-
as an array.
206+
as an array.
207207
- `partId` (string) (required): The part ID of the component used to capture the data.
208208
- `componentType` (string) (required): The type of the component used to capture the data
209-
(for example, "movementSensor").
209+
(for example, "movementSensor").
210210
- `componentName` (string) (required): The name of the component used to capture the data.
211211
- `methodName` (string) (required): The name of the method used to capture the data.
212212
- `dataRequestTimes` (Date) (required): Array of Date tuples, each containing two Date
213-
objects denoting the times this data was requested[0] by the robot and
214-
received[1] from the appropriate sensor. Passing a list of tabular data
215-
and Timestamps with length n > 1 will result in n datapoints being
216-
uploaded, all tied to the same metadata.
213+
objects denoting the times this data was requested[0] by the robot and
214+
received[1] from the appropriate sensor. Passing a list of tabular data
215+
and Timestamps with length n > 1 will result in n datapoints being
216+
uploaded, all tied to the same metadata.
217217
- `tags` (string) (optional): The list of tags to allow for tag-based filtering when
218-
retrieving data.
218+
retrieving data.
219219

220220
**Returns:**
221221

@@ -227,15 +227,20 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
227227
const fileId = await dataClient.tabularDataCaptureUpload(
228228
[
229229
{
230-
timestamp: "2025-03-26T10:00:00Z",
230+
timestamp: '2025-03-26T10:00:00Z',
231231
value: 10,
232232
},
233233
],
234-
"123abc45-1234-5678-90ab-cdef12345678",
235-
"rdk:component:sensor",
236-
"my-sensor",
237-
"Readings",
238-
[[new Date("2025-03-26T10:00:00Z"), new Date("2025-03-26T10:00:00Z")]],
234+
'123abc45-1234-5678-90ab-cdef12345678',
235+
'rdk:component:sensor',
236+
'my-sensor',
237+
'Readings',
238+
[
239+
[
240+
new Date('2025-03-26T10:00:00Z'),
241+
new Date('2025-03-26T10:00:00Z'),
242+
],
243+
]
239244
);
240245
```
241246

@@ -246,18 +251,18 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
246251

247252
**Parameters:**
248253

249-
- `tabularData` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>> (required)
254+
- `tabularData` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic\>\> (required)
250255
- `partId` [String](https://api.flutter.dev/flutter/dart-core/String-class.html) (required)
251256
- `componentType` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
252257
- `componentName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
253258
- `methodName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
254-
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any>? (optional)
255-
- `dataRequestTimes` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<([DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html), [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html))>? (optional)
256-
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> (optional)
259+
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any\>? (optional)
260+
- `dataRequestTimes` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<([DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html), [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html))\>? (optional)
261+
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\> (optional)
257262

258263
**Returns:**
259264

260-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)>
265+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\>
261266

262267
**Example:**
263268

@@ -359,12 +364,12 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
359364
- `componentType` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
360365
- `componentName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
361366
- `methodName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
362-
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any>? (optional)
363-
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> (optional)
367+
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any\>? (optional)
368+
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\> (optional)
364369

365370
**Returns:**
366371

367-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)>
372+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\>
368373

369374
**Example:**
370375

@@ -513,19 +518,19 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
513518

514519
**Parameters:**
515520

516-
- `bytes` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[int](https://api.flutter.dev/flutter/dart-core/int-class.html)> (required)
521+
- `bytes` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[int](https://api.flutter.dev/flutter/dart-core/int-class.html)\> (required)
517522
- `partId` [String](https://api.flutter.dev/flutter/dart-core/String-class.html) (required)
518523
- `fileExtension` [String](https://api.flutter.dev/flutter/dart-core/String-class.html) (required)
519524
- `componentType` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
520525
- `componentName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
521526
- `methodName` [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? (optional)
522-
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any>? (optional)
527+
- `methodParameters` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), Any\>? (optional)
523528
- `dataRequestTimes` ([DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html), [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html))? (optional)
524-
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> (optional)
529+
- `tags` [Iterable](https://api.flutter.dev/flutter/dart-core/Iterable-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\> (optional)
525530

526531
**Returns:**
527532

528-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)>
533+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\>
529534

530535
**Example:**
531536

static/include/app/apis/generated/dataset.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
6060

6161
**Returns:**
6262

63-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)>
63+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\>
6464

6565
**Example:**
6666

@@ -141,7 +141,7 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
141141

142142
**Returns:**
143143

144-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<void>
144+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<void\>
145145

146146
**Example:**
147147

@@ -229,7 +229,7 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
229229

230230
**Returns:**
231231

232-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<void>
232+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<void\>
233233

234234
**Example:**
235235

@@ -313,7 +313,7 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
313313

314314
**Returns:**
315315

316-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[Dataset](https://flutter.viam.dev/viam_protos.app.dataset/Dataset-class.html)>\>
316+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[Dataset](https://flutter.viam.dev/viam_protos.app.dataset/Dataset-class.html)\>\>
317317

318318
**Example:**
319319

@@ -393,11 +393,11 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/
393393

394394
**Parameters:**
395395

396-
- `ids` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)> (required)
396+
- `ids` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html)\> (required)
397397

398398
**Returns:**
399399

400-
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[Dataset](https://flutter.viam.dev/viam_protos.app.dataset/Dataset-class.html)>\>
400+
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[Dataset](https://flutter.viam.dev/viam_protos.app.dataset/Dataset-class.html)\>\>
401401

402402
**Example:**
403403

0 commit comments

Comments
 (0)