Skip to content

@camera.ui/sdk / sensor / SensorLike

Interface: SensorLike

Defined in: sensor/base.ts:143

Read-only proxy interface for a sensor. This is what other plugins and the backend see — use this type when consuming sensors, not creating them.

All state-modifying methods (setOn, reportDetections, etc.) live on the concrete sensor classes, not on SensorLike. Code that holds a SensorLike reference can only READ state and observe changes.

Extended by

Properties

capabilities

readonly capabilities: string[]

Defined in: sensor/base.ts:149


displayName

readonly displayName: string

Defined in: sensor/base.ts:147


id

readonly id: string

Defined in: sensor/base.ts:144


name

readonly name: string

Defined in: sensor/base.ts:146


onCapabilitiesChanged

readonly onCapabilitiesChanged: Observable<string[]>

Defined in: sensor/base.ts:170

Observable for capability changes. Emits the full capabilities array when capabilities change.


onPropertyChanged

readonly onPropertyChanged: Observable<{ property: string; timestamp: number; value: unknown; }>

Defined in: sensor/base.ts:168

Observable for property changes. Emits { property, value, timestamp } when any property changes.


pluginId?

readonly optional pluginId?: string

Defined in: sensor/base.ts:148


type

readonly type: SensorType

Defined in: sensor/base.ts:145

Methods

getValue()

getValue(property): unknown

Defined in: sensor/base.ts:152

Get the current value of a sensor property

Parameters

property

string

Returns

unknown


getValues()

getValues(): Readonly<Record<string, unknown>>

Defined in: sensor/base.ts:154

Get a read-only snapshot of all property values

Returns

Readonly<Record<string, unknown>>


hasCapability()

hasCapability(capability): boolean

Defined in: sensor/base.ts:171

Parameters

capability

string

Returns

boolean


updateValue()

updateValue(property, value): void | Promise<void>

Defined in: sensor/base.ts:166

Write a property generically. Cross-process bridges (e.g. HomeKit) bind generic property names to UI characteristics and call this on a sensor proxy — the proxy forwards via RPC to the owning sensor, where control sensor classes (Light, Siren, etc.) override updateValue to dispatch to the appropriate semantic method (setOn, setActive, ...). This means plugin-side hardware-action overrides ARE honored end-to-end.

Plugin authors must not call this — they should call the semantic methods directly on the concrete sensor class.

Parameters

property

string

value

unknown

Returns

void | Promise<void>