Dominevo
ReferenceDevice capabilities

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 via device-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

Capabilityfeature-probe
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/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.

FieldTypeRequiredDescription
flagsRecord<string, unknown>yesDriver-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.
deviceTypestring | nullyesCoarse driver-classification — lets cross-process consumers tell apart cameras / battery-cams / NVRs without re-running the probe. null before the first probe completes.
modelstring | nullyesCamera/firmware model string. null when the firmware doesn't expose it.
channelCountnumber | nullyesChannel count for NVR/Hub devices; 1 for standalone cameras; null pre-probe.
lastProbedAtnumberyesMs 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.
lastFetchedAtnumberyesFramework 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).

FieldTypeRequiredDescription
deviceIdnumberyes
status{ flags: Record<string, unknown>; deviceType: string | null; model: string | null; channelCount: number | null; lastProbedAt: number; lastFetchedAt: number }yes