ReferenceDevice capabilities
device-state-refresh
device-state-refresh — the HOW of a device's state refresh, called by the core, which owns the WHEN.
device-state-refresh — the HOW of a device's state refresh, called by the core, which owns the WHEN.
The provider registers it per device with its policy (registerNativeCap(cap, provider, { stateRefresh })). The hub's scheduler calls refresh on the schedule, after a command and in the burst that follows it, and resubscribe when a push integration fell silent. The provider re-reads and writes the slices it already writes; nothing is returned but completion.
At a glance
| Capability | device-state-refresh |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | any (no device type declared) |
| Source | packages/types/src/capabilities/device-state-refresh.cap.ts |
Methods
Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
refresh | mutation | yes | admin |
resubscribe | mutation | yes | admin |
refresh
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
deviceIds | number[] | yes | Every device to re-read: one, or the integration's whole set when the provider batches. |
reason | "schedule" | "command" | "burst" | yes |
Output
| Field | Type | Required | Description |
|---|---|---|---|
ok | true | yes |
resubscribe
mutation
Input
No fields besides deviceId.
Output
| Field | Type | Required | Description |
|---|---|---|---|
ok | true | yes |