Skip to content

@camera.ui/sdk / sensor / defineSensor

Function: defineSensor()

defineSensor<M>(meta): M

Defined in: sensor/meta.ts:151

Declares the metadata for a sensor type: how it is assigned, scheduled, and optionally created as a virtual sensor.

Type Parameters

M

M extends SensorMeta

Parameters

meta

M

The sensor's metadata.

Returns

M

The same metadata, with type and assignmentKey preserved as literal types so the registry can be checked for completeness and its keys derived.

Example

ts
export const lightMeta = defineSensor({
  type: SensorType.Light,
  category: SensorCategory.Control,
  assignmentKey: 'light',
  multiProvider: true,
  isDetectionType: false,
});