Dominevo
ReferenceDevice capabilities

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

Capabilitydevice-status
Provided byThe device's own driver provides it: each device registers its own provider.
Active providers per deviceone
Device typesany (no device type declared)
Sourcepackages/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.

FieldTypeRequiredDescription
onlinebooleanyesDevice-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.
lastChangedAtnumberyesMs 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.

FieldTypeRequiredDescription
deviceIdnumberyes
status{ online: boolean; lastChangedAt: number }yes