Parent Trait
API Service: ParentApi
ParentApi describes the capabilities of a device to have child devices.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| ListChildren | ListChildrenRequest | ListChildrenResponse | ListChildren returns children associated with the named parent device. |
| PullChildren | PullChildrenRequest | PullChildrenResponse stream | PullChildren subscribes to changes in the children associated with the named parent device. |
Info Service: ParentInfo
todo: define ParentInfo
No methods defined for this service.
Child
Child is a member of a parent.
| Field Name | Type | Description |
|---|---|---|
| name | string | Name is the Smart Core name for this child device. |
| traits | repeated Trait | Traits lists the traits this child implements. |
| parent | string | Parent is the name of this child's direct parent. If absent this is the name of the device in the children request. |
Trait
| Field Name | Type | Description |
|---|---|---|
| name | string | The qualified name of the trait. For example smartcore.traits.Parent |
ListChildrenRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | Name of the device to fetch the state for |
| read_mask | google.protobuf.FieldMask | Fields to fetch relative to the ElectricMode type |
| page_size | int32 | The maximum number of children to return. The service may return fewer than this value. If unspecified, at most 50 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| page_token | string | A page token, received from a previous ListChildrenResponse call. Provide this to retrieve the subsequent page. |
ListChildrenResponse
| Field Name | Type | Description |
|---|---|---|
| children | repeated Child | |
| next_page_token | string | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
| total_size | int32 | If non-zero this is the total number of draw notifications. This may be an estimate. |
PullChildrenRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | Name of the device to fetch the state for |
| read_mask | google.protobuf.FieldMask | Fields to fetch relative to the ElectricMode type |
| updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullChildrenResponse
| Field Name | Type | Description |
|---|---|---|
| changes | repeated PullChildrenResponse.Change | The list of changes which have occurred |
PullChildrenResponse.Change
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the device that emitted this change |
| type | smartcore.types.ChangeType | The type of change (e.g. ADD, UPDATE, etc...) |
| new_value | Child | The new value to use for ADD |
| old_value | Child | The old value to use for UPDATE |
| change_time | google.protobuf.Timestamp | When the change occurred |