feature-probe
Per-device feature/identity probe slice.
Per-device feature/identity probe slice. Holds the runtime-resolved truth about what a device CAN do — which the kernel uses to:
- Reconcile accessory children (hub-children spawn siren/floodlight/PIR based on what the firmware actually advertises).
- Compute the public
features: DeviceFeature[]array surfaced viadevice-manager.listAll. - Decide which optional caps (PTZ, intercom, doorbell, battery, …) to register on the device's capability surface.
Auto-registered by BaseDevice for every device. Drivers populate the slice from onProbe() (kernel calls it once after register, before accessory reconciliation). Consumers read via: runtimeState.getCapState<FeatureProbeStatus>('feature-probe')
flags is an open record so each driver carries its own keys without a centralized schema bottleneck — Reolink writes hasPtz/hasIntercom, Hikvision writes hasSupplementalLight/hasAlarmIo, etc.
Replaces the older driver-local deviceCache.has* blob: the per-device config is for operator-edited overrides + UI snapshots; runtime probe results belong in runtime-state where the kernel handles persistence, cross-process mirroring, and reactive updates.
At a glance
| Capability | feature-probe |
| 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/feature-probe.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 |
|---|---|---|---|
flags | Record<string, unknown> | yes | Driver-specific flag bag. Each driver picks its own key names — the cap deliberately does NOT enforce a closed enum here. Reolink keys: hasPtz, hasIntercom, hasDoorbell, hasFloodlight, hasSiren, hasPirSensor, hasAutotrack, hasBattery. Hikvision keys: hasSupplementalLight, lightHasWhiteLight, hasAlarmIo, hasPtz. |
deviceType | string | null | yes | Coarse driver-classification — lets cross-process consumers tell apart cameras / battery-cams / NVRs without re-running the probe. null before the first probe completes. |
model | string | null | yes | Camera/firmware model string. null when the firmware doesn't expose it. |
channelCount | number | null | yes | Channel count for NVR/Hub devices; 1 for standalone cameras; null pre-probe. |
lastProbedAt | number | yes | Ms epoch of the last SUCCESSFUL probe. 0 before the first probe completes — drivers' getAccessoryChildren() should treat zero as "probe not done yet, return empty" so accessories aren't spawned before the firmware is queried. |
lastFetchedAt | number | yes | Framework convention: every runtime-state slice carries this for the createRuntimeStateBridge stale-check helper. We keep it in sync with lastProbedAt on every write. |
Events
onProbeChanged
Fires whenever a fresh probe completes (kernel-driven reprobe() or driver-initiated re-detect after a state change).
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
status | { flags: Record<string, unknown>; deviceType: string | null; model: string | null; channelCount: number | null; lastProbedAt: number; lastFetchedAt: number } | yes |