device-status
Generic device-level status snapshot.
Generic device-level status snapshot. Auto-registered by BaseDevice for every device, regardless of provider — the kernel needs a uniform cap-keyed slice for the basic device flags every consumer expects to read across processes (the online flag in particular). Driver-specific caps (battery, doorbell, …) carry their domain-specific state on their own slices.
Pattern is identical to battery: schema-bearing runtimeState, empty methods, single change event. Reads land at runtimeState.getCapState('device-status'); writes at runtimeState.setCapState('device-status', …). Cross-process consumers reach the same data via the device-state cap router (getCapSlice({deviceId, capName: 'device-status'})).
At a glance
| Capability | device-status |
| 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-status.cap.ts |
Methods
This capability declares no methods.
Runtime state
The state Dominevo keeps for each device with this capability, readable without calling the provider.
| Field | Type | Required | Description |
|---|---|---|---|
online | boolean | yes | Device-level liveness. Drivers flip via markOnline(boolean) on BaseDevice. Provider semantics vary — RTSP aggregates broker stream-health, Reolink reads firmware push events, ONVIF tracks ping responses. This cap intentionally does NOT prescribe which signal drives the flag. |
lastChangedAt | number | yes | Ms epoch of the last online transition. Lets consumers tell apart "just came online" from "still online". |
Events
onStatusChanged
Emitted when online transitions. Mirrors the semantics of battery.onStatusChanged.
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
status | { online: boolean; lastChangedAt: number } | yes |