@camera.ui/sdk 0.0.22 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1258 -285
- package/dist/internal/index.d.ts +13 -11
- package/dist/plugin/helper.js +2 -25
- package/dist/sensor/audio.js +11 -0
- package/dist/sensor/base.js +1 -1
- package/dist/sensor/battery.js +22 -2
- package/dist/sensor/classifier.js +11 -0
- package/dist/sensor/clip.js +11 -0
- package/dist/sensor/contact.js +19 -0
- package/dist/sensor/detection.js +3 -1
- package/dist/sensor/doorbell.js +19 -0
- package/dist/sensor/face.js +11 -0
- package/dist/sensor/garage.js +26 -0
- package/dist/sensor/humidity.js +21 -2
- package/dist/sensor/index.js +2 -0
- package/dist/sensor/leak.js +19 -0
- package/dist/sensor/licensePlate.js +11 -0
- package/dist/sensor/light.js +25 -3
- package/dist/sensor/lock.js +19 -0
- package/dist/sensor/meta.js +35 -0
- package/dist/sensor/motion.js +11 -0
- package/dist/sensor/object.js +11 -0
- package/dist/sensor/occupancy.js +19 -0
- package/dist/sensor/ptz.js +20 -1
- package/dist/sensor/registry.js +64 -0
- package/dist/sensor/securitySystem.js +25 -0
- package/dist/sensor/siren.js +22 -3
- package/dist/sensor/smoke.js +19 -0
- package/dist/sensor/switch.js +18 -0
- package/dist/sensor/temperature.js +19 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -67,9 +67,14 @@ type MotionResolution = 'low' | 'medium' | 'high';
|
|
|
67
67
|
*/
|
|
68
68
|
type VideoStreamingMode = 'auto' | 'webrtc' | 'mse' | 'webrtc/tcp';
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Built-in aspect ratio presets offered as quick picks in the UI.
|
|
71
71
|
*/
|
|
72
|
-
type
|
|
72
|
+
type CameraAspectRatioPreset = '16:9' | '9:16' | '8:3' | '4:3' | '1:1';
|
|
73
|
+
/**
|
|
74
|
+
* Camera aspect ratio for UI display. One of the presets, or any custom
|
|
75
|
+
* `width:height` ratio (validated as `W:H` on the server).
|
|
76
|
+
*/
|
|
77
|
+
type CameraAspectRatio = CameraAspectRatioPreset | `${number}:${number}`;
|
|
73
78
|
/**
|
|
74
79
|
* Line crossing direction filter.
|
|
75
80
|
* - `both`: Trigger on crossings in either direction
|
|
@@ -838,6 +843,10 @@ interface DeviceStorage<T extends Record<string, any> = Record<string, any>> {
|
|
|
838
843
|
save(): Promise<void>;
|
|
839
844
|
}
|
|
840
845
|
|
|
846
|
+
/** Object-detection labels the detector groups its classes into. */
|
|
847
|
+
declare const OBJECT_DETECTION_LABELS: readonly ["person", "vehicle", "animal", "package"];
|
|
848
|
+
/** Union of the object-detection label strings. */
|
|
849
|
+
type ObjectDetectionLabel = (typeof OBJECT_DETECTION_LABELS)[number];
|
|
841
850
|
/** Built-in detection label types recognized across the system. */
|
|
842
851
|
declare const DETECTION_LABELS: readonly ["motion", "person", "vehicle", "animal", "package", "audio"];
|
|
843
852
|
/** Union of the built-in detection label strings. */
|
|
@@ -847,24 +856,24 @@ declare const DETECTION_ATTRIBUTES: readonly ["face", "license_plate"];
|
|
|
847
856
|
/** Union of the built-in detection attribute strings. */
|
|
848
857
|
type DetectionAttribute = (typeof DETECTION_ATTRIBUTES)[number];
|
|
849
858
|
/**
|
|
850
|
-
* Bounding box of a detection. All coordinates are normalized to 0
|
|
859
|
+
* Bounding box of a detection. All coordinates are normalized to 0-1
|
|
851
860
|
* (fraction of frame dimensions), so they are independent of resolution.
|
|
852
861
|
*/
|
|
853
862
|
interface BoundingBox {
|
|
854
|
-
/** X coordinate of the top-left corner (0
|
|
863
|
+
/** X coordinate of the top-left corner (0-1). */
|
|
855
864
|
x: number;
|
|
856
|
-
/** Y coordinate of the top-left corner (0
|
|
865
|
+
/** Y coordinate of the top-left corner (0-1). */
|
|
857
866
|
y: number;
|
|
858
|
-
/** Width as a fraction of frame width (0
|
|
867
|
+
/** Width as a fraction of frame width (0-1). */
|
|
859
868
|
width: number;
|
|
860
|
-
/** Height as a fraction of frame height (0
|
|
869
|
+
/** Height as a fraction of frame height (0-1). */
|
|
861
870
|
height: number;
|
|
862
871
|
}
|
|
863
872
|
/** A single detection result emitted by any detection sensor. */
|
|
864
873
|
interface Detection {
|
|
865
874
|
/** Detection label (e.g. `'person'`, `'vehicle'`). */
|
|
866
875
|
label: DetectionLabel;
|
|
867
|
-
/** Confidence score in the range 0
|
|
876
|
+
/** Confidence score in the range 0-1. */
|
|
868
877
|
confidence: number;
|
|
869
878
|
/** Bounding box in normalized coordinates. */
|
|
870
879
|
box: BoundingBox;
|
|
@@ -1097,6 +1106,99 @@ declare abstract class AudioDetectorSensor<TStorage extends object = Record<stri
|
|
|
1097
1106
|
/** Analyze a single audio frame for events. Called by the backend at the configured cadence. */
|
|
1098
1107
|
abstract detectAudio(audio: AudioFrameData): Promise<AudioResult>;
|
|
1099
1108
|
}
|
|
1109
|
+
/** Registry metadata for {@link AudioSensor}. */
|
|
1110
|
+
declare const audioMeta: {
|
|
1111
|
+
readonly type: SensorType.Audio;
|
|
1112
|
+
readonly category: SensorCategory.Sensor;
|
|
1113
|
+
readonly assignmentKey: "audio";
|
|
1114
|
+
readonly multiProvider: false;
|
|
1115
|
+
readonly isDetectionType: true;
|
|
1116
|
+
readonly properties: AudioProperty[];
|
|
1117
|
+
readonly semantics: null;
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
/** Condition under which a sensor arms an automation cascade. */
|
|
1121
|
+
interface SensorCascadeTrigger {
|
|
1122
|
+
readonly property: string;
|
|
1123
|
+
readonly value: unknown;
|
|
1124
|
+
readonly sustained: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
/** Initial property values and capabilities for a user-created virtual sensor. */
|
|
1127
|
+
interface SensorVirtualDefaults {
|
|
1128
|
+
readonly properties: Readonly<Record<string, unknown>>;
|
|
1129
|
+
readonly capabilities?: readonly string[];
|
|
1130
|
+
}
|
|
1131
|
+
/** The kind of thing a sensor is, used by consumers to pick how to render it. */
|
|
1132
|
+
declare enum SensorDomain {
|
|
1133
|
+
Binary = "binary",
|
|
1134
|
+
Measurement = "measurement",
|
|
1135
|
+
Switch = "switch",
|
|
1136
|
+
Light = "light",
|
|
1137
|
+
Siren = "siren",
|
|
1138
|
+
Lock = "lock",
|
|
1139
|
+
Cover = "cover",
|
|
1140
|
+
Alarm = "alarm"
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* What a sensor means, independent of any transport: which property holds its
|
|
1144
|
+
* state, which takes commands, its unit and state mapping. Consumers (MQTT
|
|
1145
|
+
* discovery, the HA integration) render from this instead of their own switch.
|
|
1146
|
+
*/
|
|
1147
|
+
interface SensorSemantics {
|
|
1148
|
+
readonly domain: SensorDomain;
|
|
1149
|
+
readonly stateProperty: string;
|
|
1150
|
+
readonly commandProperty: string;
|
|
1151
|
+
readonly deviceClass?: string;
|
|
1152
|
+
readonly unit?: string;
|
|
1153
|
+
readonly icon?: string;
|
|
1154
|
+
readonly diagnostic?: boolean;
|
|
1155
|
+
readonly states?: Readonly<Record<string, number>>;
|
|
1156
|
+
readonly brightness?: {
|
|
1157
|
+
readonly property: string;
|
|
1158
|
+
readonly scale: number;
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Metadata for a sensor type, declared alongside its class via {@link defineSensor}.
|
|
1163
|
+
*
|
|
1164
|
+
* Collected into the sensor registry, from which plugin assignment keys and the
|
|
1165
|
+
* host's per-type tables derive, so each type is described once instead of in
|
|
1166
|
+
* several parallel tables that drift apart.
|
|
1167
|
+
*/
|
|
1168
|
+
interface SensorMeta {
|
|
1169
|
+
readonly type: SensorType;
|
|
1170
|
+
readonly category: SensorCategory;
|
|
1171
|
+
readonly assignmentKey: string;
|
|
1172
|
+
readonly multiProvider: boolean;
|
|
1173
|
+
readonly isDetectionType: boolean;
|
|
1174
|
+
readonly properties: readonly string[];
|
|
1175
|
+
readonly shortcutable?: boolean;
|
|
1176
|
+
readonly cascadeTrigger?: SensorCascadeTrigger;
|
|
1177
|
+
readonly propertyCapabilities?: Readonly<Record<string, string>>;
|
|
1178
|
+
readonly virtual?: SensorVirtualDefaults;
|
|
1179
|
+
readonly semantics?: SensorSemantics | null;
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Declares the metadata for a sensor type: how it is assigned, scheduled, and
|
|
1183
|
+
* optionally created as a virtual sensor.
|
|
1184
|
+
*
|
|
1185
|
+
* @param meta - The sensor's metadata.
|
|
1186
|
+
*
|
|
1187
|
+
* @returns The same metadata, with `type` and `assignmentKey` preserved as literal
|
|
1188
|
+
* types so the registry can be checked for completeness and its keys derived.
|
|
1189
|
+
*
|
|
1190
|
+
* @example
|
|
1191
|
+
* ```ts
|
|
1192
|
+
* export const lightMeta = defineSensor({
|
|
1193
|
+
* type: SensorType.Light,
|
|
1194
|
+
* category: SensorCategory.Control,
|
|
1195
|
+
* assignmentKey: 'light',
|
|
1196
|
+
* multiProvider: true,
|
|
1197
|
+
* isDetectionType: false,
|
|
1198
|
+
* });
|
|
1199
|
+
* ```
|
|
1200
|
+
*/
|
|
1201
|
+
declare function defineSensor<const M extends SensorMeta>(meta: M): M;
|
|
1100
1202
|
|
|
1101
1203
|
/** Optional capabilities for battery info sensors */
|
|
1102
1204
|
declare enum BatteryCapability {
|
|
@@ -1111,7 +1213,7 @@ declare enum BatteryCapability {
|
|
|
1111
1213
|
* @internal
|
|
1112
1214
|
*/
|
|
1113
1215
|
declare enum BatteryProperty {
|
|
1114
|
-
/** Battery level percentage (0
|
|
1216
|
+
/** Battery level percentage (0-100) */
|
|
1115
1217
|
Level = "level",
|
|
1116
1218
|
/** Current charging state */
|
|
1117
1219
|
Charging = "charging",
|
|
@@ -1165,7 +1267,7 @@ declare class BatteryInfo<TStorage extends object = Record<string, any>> extends
|
|
|
1165
1267
|
/**
|
|
1166
1268
|
* Report a new battery level (percentage). Clamped to [0, 100].
|
|
1167
1269
|
*
|
|
1168
|
-
* @param value - Battery level percentage in the range 0
|
|
1270
|
+
* @param value - Battery level percentage in the range 0-100.
|
|
1169
1271
|
*
|
|
1170
1272
|
* @example
|
|
1171
1273
|
* ```ts
|
|
@@ -1211,6 +1313,28 @@ declare class BatteryInfo<TStorage extends object = Record<string, any>> extends
|
|
|
1211
1313
|
*/
|
|
1212
1314
|
updateValue(_property: string, _value: unknown): void;
|
|
1213
1315
|
}
|
|
1316
|
+
/** Registry metadata for {@link BatteryInfo}. */
|
|
1317
|
+
declare const batteryMeta: {
|
|
1318
|
+
readonly type: SensorType.Battery;
|
|
1319
|
+
readonly category: SensorCategory.Info;
|
|
1320
|
+
readonly assignmentKey: "battery";
|
|
1321
|
+
readonly multiProvider: false;
|
|
1322
|
+
readonly isDetectionType: false;
|
|
1323
|
+
readonly properties: BatteryProperty[];
|
|
1324
|
+
readonly shortcutable: true;
|
|
1325
|
+
readonly propertyCapabilities: {
|
|
1326
|
+
readonly charging: BatteryCapability.Charging;
|
|
1327
|
+
readonly low: BatteryCapability.LowBattery;
|
|
1328
|
+
};
|
|
1329
|
+
readonly semantics: {
|
|
1330
|
+
readonly domain: SensorDomain.Measurement;
|
|
1331
|
+
readonly stateProperty: BatteryProperty.Level;
|
|
1332
|
+
readonly commandProperty: BatteryProperty.Level;
|
|
1333
|
+
readonly deviceClass: "battery";
|
|
1334
|
+
readonly unit: "%";
|
|
1335
|
+
readonly diagnostic: true;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1214
1338
|
|
|
1215
1339
|
/**
|
|
1216
1340
|
* Properties for contact sensors
|
|
@@ -1268,6 +1392,32 @@ declare class ContactSensor<TStorage extends object = Record<string, any>> exten
|
|
|
1268
1392
|
*/
|
|
1269
1393
|
updateValue(_property: string, _value: unknown): void;
|
|
1270
1394
|
}
|
|
1395
|
+
/** Registry metadata for {@link ContactSensor}. */
|
|
1396
|
+
declare const contactMeta: {
|
|
1397
|
+
readonly type: SensorType.Contact;
|
|
1398
|
+
readonly category: SensorCategory.Sensor;
|
|
1399
|
+
readonly assignmentKey: "contact";
|
|
1400
|
+
readonly multiProvider: true;
|
|
1401
|
+
readonly isDetectionType: false;
|
|
1402
|
+
readonly properties: ContactProperty.Detected[];
|
|
1403
|
+
readonly shortcutable: true;
|
|
1404
|
+
readonly cascadeTrigger: {
|
|
1405
|
+
readonly property: ContactProperty;
|
|
1406
|
+
readonly value: true;
|
|
1407
|
+
readonly sustained: true;
|
|
1408
|
+
};
|
|
1409
|
+
readonly virtual: {
|
|
1410
|
+
readonly properties: {
|
|
1411
|
+
readonly detected: false;
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
readonly semantics: {
|
|
1415
|
+
readonly domain: SensorDomain.Binary;
|
|
1416
|
+
readonly stateProperty: ContactProperty;
|
|
1417
|
+
readonly commandProperty: ContactProperty;
|
|
1418
|
+
readonly deviceClass: "opening";
|
|
1419
|
+
};
|
|
1420
|
+
};
|
|
1271
1421
|
|
|
1272
1422
|
/**
|
|
1273
1423
|
* Properties for doorbell triggers
|
|
@@ -1335,6 +1485,32 @@ declare class DoorbellTrigger<TStorage extends object = Record<string, any>> ext
|
|
|
1335
1485
|
updateValue(property: string, value: unknown): void;
|
|
1336
1486
|
_cleanup(): void;
|
|
1337
1487
|
}
|
|
1488
|
+
/** Registry metadata for {@link DoorbellTrigger}. */
|
|
1489
|
+
declare const doorbellMeta: {
|
|
1490
|
+
readonly type: SensorType.Doorbell;
|
|
1491
|
+
readonly category: SensorCategory.Trigger;
|
|
1492
|
+
readonly assignmentKey: "doorbell";
|
|
1493
|
+
readonly multiProvider: true;
|
|
1494
|
+
readonly isDetectionType: false;
|
|
1495
|
+
readonly properties: DoorbellProperty.Ring[];
|
|
1496
|
+
readonly shortcutable: true;
|
|
1497
|
+
readonly cascadeTrigger: {
|
|
1498
|
+
readonly property: DoorbellProperty;
|
|
1499
|
+
readonly value: true;
|
|
1500
|
+
readonly sustained: false;
|
|
1501
|
+
};
|
|
1502
|
+
readonly virtual: {
|
|
1503
|
+
readonly properties: {
|
|
1504
|
+
readonly ring: false;
|
|
1505
|
+
};
|
|
1506
|
+
};
|
|
1507
|
+
readonly semantics: {
|
|
1508
|
+
readonly domain: SensorDomain.Binary;
|
|
1509
|
+
readonly stateProperty: DoorbellProperty;
|
|
1510
|
+
readonly commandProperty: DoorbellProperty;
|
|
1511
|
+
readonly icon: "mdi:doorbell";
|
|
1512
|
+
};
|
|
1513
|
+
};
|
|
1338
1514
|
|
|
1339
1515
|
/**
|
|
1340
1516
|
* Property names of a face detection sensor.
|
|
@@ -1469,6 +1645,16 @@ declare abstract class FaceDetectorSensor<TStorage extends object = Record<strin
|
|
|
1469
1645
|
*/
|
|
1470
1646
|
abstract detectFaces(frames: VideoFrameData[]): Promise<FaceResult[]>;
|
|
1471
1647
|
}
|
|
1648
|
+
/** Registry metadata for {@link FaceSensor}. */
|
|
1649
|
+
declare const faceMeta: {
|
|
1650
|
+
readonly type: SensorType.Face;
|
|
1651
|
+
readonly category: SensorCategory.Sensor;
|
|
1652
|
+
readonly assignmentKey: "face";
|
|
1653
|
+
readonly multiProvider: false;
|
|
1654
|
+
readonly isDetectionType: true;
|
|
1655
|
+
readonly properties: FaceProperty[];
|
|
1656
|
+
readonly semantics: null;
|
|
1657
|
+
};
|
|
1472
1658
|
|
|
1473
1659
|
/** Garage door states (HomeKit-compatible values) */
|
|
1474
1660
|
declare enum GarageState {
|
|
@@ -1580,6 +1766,40 @@ declare class GarageControl<TStorage extends object = Record<string, any>> exten
|
|
|
1580
1766
|
*/
|
|
1581
1767
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
1582
1768
|
}
|
|
1769
|
+
/** Registry metadata for {@link GarageControl}. */
|
|
1770
|
+
declare const garageMeta: {
|
|
1771
|
+
readonly type: SensorType.Garage;
|
|
1772
|
+
readonly category: SensorCategory.Control;
|
|
1773
|
+
readonly assignmentKey: "garage";
|
|
1774
|
+
readonly multiProvider: true;
|
|
1775
|
+
readonly isDetectionType: false;
|
|
1776
|
+
readonly properties: GarageProperty[];
|
|
1777
|
+
readonly shortcutable: true;
|
|
1778
|
+
readonly cascadeTrigger: {
|
|
1779
|
+
readonly property: GarageProperty.CurrentState;
|
|
1780
|
+
readonly value: 0;
|
|
1781
|
+
readonly sustained: true;
|
|
1782
|
+
};
|
|
1783
|
+
readonly virtual: {
|
|
1784
|
+
readonly properties: {
|
|
1785
|
+
readonly currentState: 1;
|
|
1786
|
+
readonly targetState: 1;
|
|
1787
|
+
};
|
|
1788
|
+
};
|
|
1789
|
+
readonly semantics: {
|
|
1790
|
+
readonly domain: SensorDomain.Cover;
|
|
1791
|
+
readonly stateProperty: GarageProperty.CurrentState;
|
|
1792
|
+
readonly commandProperty: GarageProperty.TargetState;
|
|
1793
|
+
readonly deviceClass: "garage";
|
|
1794
|
+
readonly states: {
|
|
1795
|
+
readonly open: GarageState.Open;
|
|
1796
|
+
readonly closed: GarageState.Closed;
|
|
1797
|
+
readonly opening: GarageState.Opening;
|
|
1798
|
+
readonly closing: GarageState.Closing;
|
|
1799
|
+
readonly stopped: GarageState.Stopped;
|
|
1800
|
+
};
|
|
1801
|
+
};
|
|
1802
|
+
};
|
|
1583
1803
|
|
|
1584
1804
|
/**
|
|
1585
1805
|
* Properties for humidity sensors
|
|
@@ -1587,7 +1807,7 @@ declare class GarageControl<TStorage extends object = Record<string, any>> exten
|
|
|
1587
1807
|
* @internal
|
|
1588
1808
|
*/
|
|
1589
1809
|
declare enum HumidityProperty {
|
|
1590
|
-
/** Current relative humidity (0
|
|
1810
|
+
/** Current relative humidity (0-100%) */
|
|
1591
1811
|
Current = "current"
|
|
1592
1812
|
}
|
|
1593
1813
|
/**
|
|
@@ -1614,7 +1834,7 @@ declare class HumidityInfo<TStorage extends object = Record<string, any>> extend
|
|
|
1614
1834
|
/**
|
|
1615
1835
|
* Report a new humidity reading. Clamped to [0, 100] %.
|
|
1616
1836
|
*
|
|
1617
|
-
* @param value - Relative humidity percentage in the range 0
|
|
1837
|
+
* @param value - Relative humidity percentage in the range 0-100.
|
|
1618
1838
|
*
|
|
1619
1839
|
* @example
|
|
1620
1840
|
* ```ts
|
|
@@ -1637,6 +1857,28 @@ declare class HumidityInfo<TStorage extends object = Record<string, any>> extend
|
|
|
1637
1857
|
*/
|
|
1638
1858
|
updateValue(_property: string, _value: unknown): void;
|
|
1639
1859
|
}
|
|
1860
|
+
/** Registry metadata for {@link HumidityInfo}. */
|
|
1861
|
+
declare const humidityMeta: {
|
|
1862
|
+
readonly type: SensorType.Humidity;
|
|
1863
|
+
readonly category: SensorCategory.Info;
|
|
1864
|
+
readonly assignmentKey: "humidity";
|
|
1865
|
+
readonly multiProvider: true;
|
|
1866
|
+
readonly isDetectionType: false;
|
|
1867
|
+
readonly properties: HumidityProperty.Current[];
|
|
1868
|
+
readonly shortcutable: true;
|
|
1869
|
+
readonly virtual: {
|
|
1870
|
+
readonly properties: {
|
|
1871
|
+
readonly current: 50;
|
|
1872
|
+
};
|
|
1873
|
+
};
|
|
1874
|
+
readonly semantics: {
|
|
1875
|
+
readonly domain: SensorDomain.Measurement;
|
|
1876
|
+
readonly stateProperty: HumidityProperty;
|
|
1877
|
+
readonly commandProperty: HumidityProperty;
|
|
1878
|
+
readonly deviceClass: "humidity";
|
|
1879
|
+
readonly unit: "%";
|
|
1880
|
+
};
|
|
1881
|
+
};
|
|
1640
1882
|
|
|
1641
1883
|
/**
|
|
1642
1884
|
* Properties for leak sensors
|
|
@@ -1694,6 +1936,32 @@ declare class LeakSensor<TStorage extends object = Record<string, any>> extends
|
|
|
1694
1936
|
*/
|
|
1695
1937
|
updateValue(_property: string, _value: unknown): void;
|
|
1696
1938
|
}
|
|
1939
|
+
/** Registry metadata for {@link LeakSensor}. */
|
|
1940
|
+
declare const leakMeta: {
|
|
1941
|
+
readonly type: SensorType.Leak;
|
|
1942
|
+
readonly category: SensorCategory.Sensor;
|
|
1943
|
+
readonly assignmentKey: "leak";
|
|
1944
|
+
readonly multiProvider: true;
|
|
1945
|
+
readonly isDetectionType: false;
|
|
1946
|
+
readonly properties: LeakProperty.Detected[];
|
|
1947
|
+
readonly shortcutable: true;
|
|
1948
|
+
readonly cascadeTrigger: {
|
|
1949
|
+
readonly property: LeakProperty;
|
|
1950
|
+
readonly value: true;
|
|
1951
|
+
readonly sustained: true;
|
|
1952
|
+
};
|
|
1953
|
+
readonly virtual: {
|
|
1954
|
+
readonly properties: {
|
|
1955
|
+
readonly detected: false;
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
readonly semantics: {
|
|
1959
|
+
readonly domain: SensorDomain.Binary;
|
|
1960
|
+
readonly stateProperty: LeakProperty;
|
|
1961
|
+
readonly commandProperty: LeakProperty;
|
|
1962
|
+
readonly deviceClass: "moisture";
|
|
1963
|
+
};
|
|
1964
|
+
};
|
|
1697
1965
|
|
|
1698
1966
|
/**
|
|
1699
1967
|
* Property names of a license plate detection sensor.
|
|
@@ -1821,10 +2089,20 @@ declare abstract class LicensePlateDetectorSensor<TStorage extends object = Reco
|
|
|
1821
2089
|
*/
|
|
1822
2090
|
abstract detectLicensePlates(frames: VideoFrameData[]): Promise<LicensePlateResult[]>;
|
|
1823
2091
|
}
|
|
2092
|
+
/** Registry metadata for {@link LicensePlateSensor}. */
|
|
2093
|
+
declare const licensePlateMeta: {
|
|
2094
|
+
readonly type: SensorType.LicensePlate;
|
|
2095
|
+
readonly category: SensorCategory.Sensor;
|
|
2096
|
+
readonly assignmentKey: "licensePlate";
|
|
2097
|
+
readonly multiProvider: false;
|
|
2098
|
+
readonly isDetectionType: true;
|
|
2099
|
+
readonly properties: LicensePlateProperty[];
|
|
2100
|
+
readonly semantics: null;
|
|
2101
|
+
};
|
|
1824
2102
|
|
|
1825
2103
|
/** Optional capabilities for light controls */
|
|
1826
2104
|
declare enum LightCapability {
|
|
1827
|
-
/** Light supports brightness adjustment (0
|
|
2105
|
+
/** Light supports brightness adjustment (0-100) */
|
|
1828
2106
|
Brightness = "brightness"
|
|
1829
2107
|
}
|
|
1830
2108
|
/**
|
|
@@ -1835,7 +2113,7 @@ declare enum LightCapability {
|
|
|
1835
2113
|
declare enum LightProperty {
|
|
1836
2114
|
/** Whether the light is on */
|
|
1837
2115
|
On = "on",
|
|
1838
|
-
/** Brightness level (0
|
|
2116
|
+
/** Brightness level (0-100) */
|
|
1839
2117
|
Brightness = "brightness"
|
|
1840
2118
|
}
|
|
1841
2119
|
/**
|
|
@@ -1897,7 +2175,7 @@ declare class LightControl<TStorage extends object = Record<string, any>> extend
|
|
|
1897
2175
|
* Set brightness. Override to drive hardware and call `await super.setBrightness(value)`
|
|
1898
2176
|
* after the hardware call succeeds. The default implementation clamps the value to [0, 100].
|
|
1899
2177
|
*
|
|
1900
|
-
* @param value - Brightness level in the range 0
|
|
2178
|
+
* @param value - Brightness level in the range 0-100.
|
|
1901
2179
|
*
|
|
1902
2180
|
* @example
|
|
1903
2181
|
* ```ts
|
|
@@ -1918,6 +2196,36 @@ declare class LightControl<TStorage extends object = Record<string, any>> extend
|
|
|
1918
2196
|
*/
|
|
1919
2197
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
1920
2198
|
}
|
|
2199
|
+
/** Registry metadata for {@link LightControl}. */
|
|
2200
|
+
declare const lightMeta: {
|
|
2201
|
+
readonly type: SensorType.Light;
|
|
2202
|
+
readonly category: SensorCategory.Control;
|
|
2203
|
+
readonly assignmentKey: "light";
|
|
2204
|
+
readonly multiProvider: true;
|
|
2205
|
+
readonly isDetectionType: false;
|
|
2206
|
+
readonly properties: LightProperty[];
|
|
2207
|
+
readonly shortcutable: true;
|
|
2208
|
+
readonly cascadeTrigger: {
|
|
2209
|
+
readonly property: LightProperty.On;
|
|
2210
|
+
readonly value: true;
|
|
2211
|
+
readonly sustained: true;
|
|
2212
|
+
};
|
|
2213
|
+
readonly propertyCapabilities: {
|
|
2214
|
+
readonly brightness: LightCapability;
|
|
2215
|
+
};
|
|
2216
|
+
readonly virtual: {
|
|
2217
|
+
readonly properties: {
|
|
2218
|
+
readonly on: false;
|
|
2219
|
+
readonly brightness: 100;
|
|
2220
|
+
};
|
|
2221
|
+
readonly capabilities: readonly [LightCapability];
|
|
2222
|
+
};
|
|
2223
|
+
readonly semantics: {
|
|
2224
|
+
readonly domain: SensorDomain.Light;
|
|
2225
|
+
readonly stateProperty: LightProperty.On;
|
|
2226
|
+
readonly commandProperty: LightProperty.On;
|
|
2227
|
+
};
|
|
2228
|
+
};
|
|
1921
2229
|
|
|
1922
2230
|
/** Lock states (HomeKit-compatible values) */
|
|
1923
2231
|
declare enum LockState {
|
|
@@ -2010,6 +2318,36 @@ declare class LockControl<TStorage extends object = Record<string, any>> extends
|
|
|
2010
2318
|
*/
|
|
2011
2319
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
2012
2320
|
}
|
|
2321
|
+
/** Registry metadata for {@link LockControl}. */
|
|
2322
|
+
declare const lockMeta: {
|
|
2323
|
+
readonly type: SensorType.Lock;
|
|
2324
|
+
readonly category: SensorCategory.Control;
|
|
2325
|
+
readonly assignmentKey: "lock";
|
|
2326
|
+
readonly multiProvider: true;
|
|
2327
|
+
readonly isDetectionType: false;
|
|
2328
|
+
readonly properties: LockProperty[];
|
|
2329
|
+
readonly shortcutable: true;
|
|
2330
|
+
readonly cascadeTrigger: {
|
|
2331
|
+
readonly property: LockProperty.CurrentState;
|
|
2332
|
+
readonly value: 1;
|
|
2333
|
+
readonly sustained: true;
|
|
2334
|
+
};
|
|
2335
|
+
readonly virtual: {
|
|
2336
|
+
readonly properties: {
|
|
2337
|
+
readonly currentState: 0;
|
|
2338
|
+
readonly targetState: 0;
|
|
2339
|
+
};
|
|
2340
|
+
};
|
|
2341
|
+
readonly semantics: {
|
|
2342
|
+
readonly domain: SensorDomain.Lock;
|
|
2343
|
+
readonly stateProperty: LockProperty.CurrentState;
|
|
2344
|
+
readonly commandProperty: LockProperty.TargetState;
|
|
2345
|
+
readonly states: {
|
|
2346
|
+
readonly locked: LockState.Secured;
|
|
2347
|
+
readonly unlocked: LockState.Unsecured;
|
|
2348
|
+
};
|
|
2349
|
+
};
|
|
2350
|
+
};
|
|
2013
2351
|
|
|
2014
2352
|
/**
|
|
2015
2353
|
* Property names of a motion sensor.
|
|
@@ -2134,6 +2472,16 @@ declare abstract class MotionDetectorSensor<TStorage extends object = Record<str
|
|
|
2134
2472
|
/** Analyze a single video frame for motion. Called by the backend at the configured interval. */
|
|
2135
2473
|
abstract detectMotion(frame: VideoFrameData): Promise<MotionResult>;
|
|
2136
2474
|
}
|
|
2475
|
+
/** Registry metadata for {@link MotionSensor}. */
|
|
2476
|
+
declare const motionMeta: {
|
|
2477
|
+
readonly type: SensorType.Motion;
|
|
2478
|
+
readonly category: SensorCategory.Sensor;
|
|
2479
|
+
readonly assignmentKey: "motion";
|
|
2480
|
+
readonly multiProvider: false;
|
|
2481
|
+
readonly isDetectionType: true;
|
|
2482
|
+
readonly properties: MotionProperty[];
|
|
2483
|
+
readonly semantics: null;
|
|
2484
|
+
};
|
|
2137
2485
|
|
|
2138
2486
|
/**
|
|
2139
2487
|
* Property names of an object detection sensor.
|
|
@@ -2277,6 +2625,16 @@ declare abstract class ObjectDetectorSensor<TStorage extends object = Record<str
|
|
|
2277
2625
|
/** Analyze a single video frame for objects. Called by the backend at the configured interval. */
|
|
2278
2626
|
abstract detectObjects(frame: VideoFrameData): Promise<ObjectResult>;
|
|
2279
2627
|
}
|
|
2628
|
+
/** Registry metadata for {@link ObjectSensor}. */
|
|
2629
|
+
declare const objectMeta: {
|
|
2630
|
+
readonly type: SensorType.Object;
|
|
2631
|
+
readonly category: SensorCategory.Sensor;
|
|
2632
|
+
readonly assignmentKey: "object";
|
|
2633
|
+
readonly multiProvider: false;
|
|
2634
|
+
readonly isDetectionType: true;
|
|
2635
|
+
readonly properties: ObjectProperty[];
|
|
2636
|
+
readonly semantics: null;
|
|
2637
|
+
};
|
|
2280
2638
|
|
|
2281
2639
|
/**
|
|
2282
2640
|
* Properties for occupancy sensors
|
|
@@ -2334,11 +2692,40 @@ declare class OccupancySensor<TStorage extends object = Record<string, any>> ext
|
|
|
2334
2692
|
*/
|
|
2335
2693
|
updateValue(_property: string, _value: unknown): void;
|
|
2336
2694
|
}
|
|
2695
|
+
/** Registry metadata for {@link OccupancySensor}. */
|
|
2696
|
+
declare const occupancyMeta: {
|
|
2697
|
+
readonly type: SensorType.Occupancy;
|
|
2698
|
+
readonly category: SensorCategory.Sensor;
|
|
2699
|
+
readonly assignmentKey: "occupancy";
|
|
2700
|
+
readonly multiProvider: true;
|
|
2701
|
+
readonly isDetectionType: false;
|
|
2702
|
+
readonly properties: OccupancyProperty.Detected[];
|
|
2703
|
+
readonly shortcutable: true;
|
|
2704
|
+
readonly cascadeTrigger: {
|
|
2705
|
+
readonly property: OccupancyProperty;
|
|
2706
|
+
readonly value: true;
|
|
2707
|
+
readonly sustained: true;
|
|
2708
|
+
};
|
|
2709
|
+
readonly virtual: {
|
|
2710
|
+
readonly properties: {
|
|
2711
|
+
readonly detected: false;
|
|
2712
|
+
};
|
|
2713
|
+
};
|
|
2714
|
+
readonly semantics: {
|
|
2715
|
+
readonly domain: SensorDomain.Binary;
|
|
2716
|
+
readonly stateProperty: OccupancyProperty;
|
|
2717
|
+
readonly commandProperty: OccupancyProperty;
|
|
2718
|
+
readonly deviceClass: "occupancy";
|
|
2719
|
+
};
|
|
2720
|
+
};
|
|
2337
2721
|
|
|
2338
2722
|
/** Optional capabilities for PTZ controls. Add to `capabilities` to enable features. */
|
|
2339
2723
|
declare enum PTZCapability {
|
|
2724
|
+
/** Camera supports panning (horizontal movement) */
|
|
2340
2725
|
Pan = "pan",
|
|
2726
|
+
/** Camera supports tilting (vertical movement) */
|
|
2341
2727
|
Tilt = "tilt",
|
|
2728
|
+
/** Camera supports zoom */
|
|
2342
2729
|
Zoom = "zoom",
|
|
2343
2730
|
/** Camera supports named position presets */
|
|
2344
2731
|
Presets = "presets",
|
|
@@ -2368,7 +2755,9 @@ declare enum PTZProperty {
|
|
|
2368
2755
|
/** Target preset to move to */
|
|
2369
2756
|
TargetPreset = "targetPreset",
|
|
2370
2757
|
/** Relative displacement move command (write-only) */
|
|
2371
|
-
RelativeMove = "relativeMove"
|
|
2758
|
+
RelativeMove = "relativeMove",
|
|
2759
|
+
/** Move to the home position (write-only command, carries no state) */
|
|
2760
|
+
Home = "home"
|
|
2372
2761
|
}
|
|
2373
2762
|
/** Absolute PTZ position */
|
|
2374
2763
|
interface PTZPosition {
|
|
@@ -2541,7 +2930,7 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
|
|
|
2541
2930
|
* Cross-process consumer entry point. Dispatches writable properties
|
|
2542
2931
|
* to semantic methods so plugin overrides (hardware actions) are honored.
|
|
2543
2932
|
* `moving` and `presets` are observed/discovered state and not externally writable;
|
|
2544
|
-
* only `Position`, `Velocity`, `TargetPreset`, and `
|
|
2933
|
+
* only `Position`, `Velocity`, `TargetPreset`, `RelativeMove` and `Home` may be set.
|
|
2545
2934
|
*
|
|
2546
2935
|
* @param property - Property name to write.
|
|
2547
2936
|
*
|
|
@@ -2551,6 +2940,16 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
|
|
|
2551
2940
|
*/
|
|
2552
2941
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
2553
2942
|
}
|
|
2943
|
+
/** Registry metadata for {@link PTZControl}. */
|
|
2944
|
+
declare const ptzMeta: {
|
|
2945
|
+
readonly type: SensorType.PTZ;
|
|
2946
|
+
readonly category: SensorCategory.Control;
|
|
2947
|
+
readonly assignmentKey: "ptz";
|
|
2948
|
+
readonly multiProvider: false;
|
|
2949
|
+
readonly isDetectionType: false;
|
|
2950
|
+
readonly properties: PTZProperty[];
|
|
2951
|
+
readonly semantics: null;
|
|
2952
|
+
};
|
|
2554
2953
|
|
|
2555
2954
|
/** Security system arm/disarm states (HomeKit-compatible values) */
|
|
2556
2955
|
declare enum SecuritySystemState {
|
|
@@ -2647,10 +3046,43 @@ declare class SecuritySystem<TStorage extends object = Record<string, any>> exte
|
|
|
2647
3046
|
*/
|
|
2648
3047
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
2649
3048
|
}
|
|
3049
|
+
/** Registry metadata for {@link SecuritySystem}. */
|
|
3050
|
+
declare const securitySystemMeta: {
|
|
3051
|
+
readonly type: SensorType.SecuritySystem;
|
|
3052
|
+
readonly category: SensorCategory.Control;
|
|
3053
|
+
readonly assignmentKey: "securitySystem";
|
|
3054
|
+
readonly multiProvider: true;
|
|
3055
|
+
readonly isDetectionType: false;
|
|
3056
|
+
readonly properties: SecuritySystemProperty[];
|
|
3057
|
+
readonly shortcutable: true;
|
|
3058
|
+
readonly cascadeTrigger: {
|
|
3059
|
+
readonly property: SecuritySystemProperty.CurrentState;
|
|
3060
|
+
readonly value: 4;
|
|
3061
|
+
readonly sustained: true;
|
|
3062
|
+
};
|
|
3063
|
+
readonly virtual: {
|
|
3064
|
+
readonly properties: {
|
|
3065
|
+
readonly currentState: 3;
|
|
3066
|
+
readonly targetState: 3;
|
|
3067
|
+
};
|
|
3068
|
+
};
|
|
3069
|
+
readonly semantics: {
|
|
3070
|
+
readonly domain: SensorDomain.Alarm;
|
|
3071
|
+
readonly stateProperty: SecuritySystemProperty.CurrentState;
|
|
3072
|
+
readonly commandProperty: SecuritySystemProperty.TargetState;
|
|
3073
|
+
readonly states: {
|
|
3074
|
+
readonly armed_home: SecuritySystemState.StayArm;
|
|
3075
|
+
readonly armed_away: SecuritySystemState.AwayArm;
|
|
3076
|
+
readonly armed_night: SecuritySystemState.NightArm;
|
|
3077
|
+
readonly disarmed: SecuritySystemState.Disarmed;
|
|
3078
|
+
readonly triggered: SecuritySystemState.AlarmTriggered;
|
|
3079
|
+
};
|
|
3080
|
+
};
|
|
3081
|
+
};
|
|
2650
3082
|
|
|
2651
3083
|
/** Optional capabilities for siren controls */
|
|
2652
3084
|
declare enum SirenCapability {
|
|
2653
|
-
/** Siren supports volume adjustment (0
|
|
3085
|
+
/** Siren supports volume adjustment (0-100) */
|
|
2654
3086
|
Volume = "volume"
|
|
2655
3087
|
}
|
|
2656
3088
|
/**
|
|
@@ -2661,7 +3093,7 @@ declare enum SirenCapability {
|
|
|
2661
3093
|
declare enum SirenProperty {
|
|
2662
3094
|
/** Whether the siren is currently active */
|
|
2663
3095
|
Active = "active",
|
|
2664
|
-
/** Volume level (0
|
|
3096
|
+
/** Volume level (0-100) */
|
|
2665
3097
|
Volume = "volume"
|
|
2666
3098
|
}
|
|
2667
3099
|
/**
|
|
@@ -2718,7 +3150,7 @@ declare class SirenControl<TStorage extends object = Record<string, any>> extend
|
|
|
2718
3150
|
* Set volume. Override to drive hardware and call `await super.setVolume(value)`
|
|
2719
3151
|
* after success. The default implementation clamps the value to [0, 100].
|
|
2720
3152
|
*
|
|
2721
|
-
* @param value - Volume level in the range 0
|
|
3153
|
+
* @param value - Volume level in the range 0-100.
|
|
2722
3154
|
*
|
|
2723
3155
|
* @example
|
|
2724
3156
|
* ```ts
|
|
@@ -2739,6 +3171,36 @@ declare class SirenControl<TStorage extends object = Record<string, any>> extend
|
|
|
2739
3171
|
*/
|
|
2740
3172
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
2741
3173
|
}
|
|
3174
|
+
/** Registry metadata for {@link SirenControl}. */
|
|
3175
|
+
declare const sirenMeta: {
|
|
3176
|
+
readonly type: SensorType.Siren;
|
|
3177
|
+
readonly category: SensorCategory.Control;
|
|
3178
|
+
readonly assignmentKey: "siren";
|
|
3179
|
+
readonly multiProvider: true;
|
|
3180
|
+
readonly isDetectionType: false;
|
|
3181
|
+
readonly properties: SirenProperty[];
|
|
3182
|
+
readonly shortcutable: true;
|
|
3183
|
+
readonly cascadeTrigger: {
|
|
3184
|
+
readonly property: SirenProperty.Active;
|
|
3185
|
+
readonly value: true;
|
|
3186
|
+
readonly sustained: true;
|
|
3187
|
+
};
|
|
3188
|
+
readonly propertyCapabilities: {
|
|
3189
|
+
readonly volume: SirenCapability;
|
|
3190
|
+
};
|
|
3191
|
+
readonly virtual: {
|
|
3192
|
+
readonly properties: {
|
|
3193
|
+
readonly active: false;
|
|
3194
|
+
readonly volume: 100;
|
|
3195
|
+
};
|
|
3196
|
+
readonly capabilities: readonly [SirenCapability];
|
|
3197
|
+
};
|
|
3198
|
+
readonly semantics: {
|
|
3199
|
+
readonly domain: SensorDomain.Siren;
|
|
3200
|
+
readonly stateProperty: SirenProperty.Active;
|
|
3201
|
+
readonly commandProperty: SirenProperty.Active;
|
|
3202
|
+
};
|
|
3203
|
+
};
|
|
2742
3204
|
|
|
2743
3205
|
/**
|
|
2744
3206
|
* Properties for smoke sensors
|
|
@@ -2796,6 +3258,32 @@ declare class SmokeSensor<TStorage extends object = Record<string, any>> extends
|
|
|
2796
3258
|
*/
|
|
2797
3259
|
updateValue(_property: string, _value: unknown): void;
|
|
2798
3260
|
}
|
|
3261
|
+
/** Registry metadata for {@link SmokeSensor}. */
|
|
3262
|
+
declare const smokeMeta: {
|
|
3263
|
+
readonly type: SensorType.Smoke;
|
|
3264
|
+
readonly category: SensorCategory.Sensor;
|
|
3265
|
+
readonly assignmentKey: "smoke";
|
|
3266
|
+
readonly multiProvider: true;
|
|
3267
|
+
readonly isDetectionType: false;
|
|
3268
|
+
readonly properties: SmokeProperty.Detected[];
|
|
3269
|
+
readonly shortcutable: true;
|
|
3270
|
+
readonly cascadeTrigger: {
|
|
3271
|
+
readonly property: SmokeProperty;
|
|
3272
|
+
readonly value: true;
|
|
3273
|
+
readonly sustained: true;
|
|
3274
|
+
};
|
|
3275
|
+
readonly virtual: {
|
|
3276
|
+
readonly properties: {
|
|
3277
|
+
readonly detected: false;
|
|
3278
|
+
};
|
|
3279
|
+
};
|
|
3280
|
+
readonly semantics: {
|
|
3281
|
+
readonly domain: SensorDomain.Binary;
|
|
3282
|
+
readonly stateProperty: SmokeProperty;
|
|
3283
|
+
readonly commandProperty: SmokeProperty;
|
|
3284
|
+
readonly deviceClass: "smoke";
|
|
3285
|
+
};
|
|
3286
|
+
};
|
|
2799
3287
|
|
|
2800
3288
|
/**
|
|
2801
3289
|
* Properties for switch controls
|
|
@@ -2865,63 +3353,31 @@ declare class SwitchControl<TStorage extends object = Record<string, any>> exten
|
|
|
2865
3353
|
*/
|
|
2866
3354
|
updateValue(property: string, value: unknown): Promise<void>;
|
|
2867
3355
|
}
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
}
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
}
|
|
2893
|
-
/** Temperature info sensor. Reports current temperature in °C. */
|
|
2894
|
-
declare class TemperatureInfo<TStorage extends object = Record<string, any>> extends Sensor<TemperatureInfoProperties, TStorage> {
|
|
2895
|
-
readonly type = SensorType.Temperature;
|
|
2896
|
-
readonly category = SensorCategory.Info;
|
|
2897
|
-
constructor(name?: string);
|
|
2898
|
-
get current(): number;
|
|
2899
|
-
/**
|
|
2900
|
-
* Report a new temperature reading. Clamped to [-270, 100] °C.
|
|
2901
|
-
*
|
|
2902
|
-
* @param value - Temperature reading in degrees Celsius.
|
|
2903
|
-
*
|
|
2904
|
-
* @example
|
|
2905
|
-
* ```ts
|
|
2906
|
-
* temperature.setCurrent(21.5);
|
|
2907
|
-
* ```
|
|
2908
|
-
*/
|
|
2909
|
-
setCurrent(value: number): void;
|
|
2910
|
-
/**
|
|
2911
|
-
* Read-only sensor: external writes are ignored. Reading via `setCurrent` is plugin-only.
|
|
2912
|
-
*
|
|
2913
|
-
* Called by the cross-process plugin host when a generic property write is received.
|
|
2914
|
-
* Temperature sensors have no externally writable properties, so the parameters are
|
|
2915
|
-
* unused (underscore-prefixed) and the call is a no-op.
|
|
2916
|
-
*
|
|
2917
|
-
* @param _property - Unused — temperature sensors expose no writable properties.
|
|
2918
|
-
*
|
|
2919
|
-
* @param _value - Unused — temperature sensors expose no writable properties.
|
|
2920
|
-
*
|
|
2921
|
-
* @internal
|
|
2922
|
-
*/
|
|
2923
|
-
updateValue(_property: string, _value: unknown): void;
|
|
2924
|
-
}
|
|
3356
|
+
/** Registry metadata for {@link SwitchControl}. */
|
|
3357
|
+
declare const switchMeta: {
|
|
3358
|
+
readonly type: SensorType.Switch;
|
|
3359
|
+
readonly category: SensorCategory.Control;
|
|
3360
|
+
readonly assignmentKey: "switch";
|
|
3361
|
+
readonly multiProvider: true;
|
|
3362
|
+
readonly isDetectionType: false;
|
|
3363
|
+
readonly properties: SwitchProperty.On[];
|
|
3364
|
+
readonly shortcutable: true;
|
|
3365
|
+
readonly cascadeTrigger: {
|
|
3366
|
+
readonly property: SwitchProperty;
|
|
3367
|
+
readonly value: true;
|
|
3368
|
+
readonly sustained: true;
|
|
3369
|
+
};
|
|
3370
|
+
readonly virtual: {
|
|
3371
|
+
readonly properties: {
|
|
3372
|
+
readonly on: false;
|
|
3373
|
+
};
|
|
3374
|
+
};
|
|
3375
|
+
readonly semantics: {
|
|
3376
|
+
readonly domain: SensorDomain.Switch;
|
|
3377
|
+
readonly stateProperty: SwitchProperty;
|
|
3378
|
+
readonly commandProperty: SwitchProperty;
|
|
3379
|
+
};
|
|
3380
|
+
};
|
|
2925
3381
|
|
|
2926
3382
|
/**
|
|
2927
3383
|
* Receives a partial-state delta (only properties that actually changed). One callback
|
|
@@ -2977,7 +3433,7 @@ declare enum SensorType {
|
|
|
2977
3433
|
Contact = "contact",
|
|
2978
3434
|
/** Temperature sensor (°C) */
|
|
2979
3435
|
Temperature = "temperature",
|
|
2980
|
-
/** Humidity sensor (0
|
|
3436
|
+
/** Humidity sensor (0-100%) */
|
|
2981
3437
|
Humidity = "humidity",
|
|
2982
3438
|
/** Occupancy/presence sensor */
|
|
2983
3439
|
Occupancy = "occupancy",
|
|
@@ -3322,55 +3778,710 @@ declare abstract class Sensor<TProperties extends object, TStorage extends objec
|
|
|
3322
3778
|
}
|
|
3323
3779
|
|
|
3324
3780
|
/**
|
|
3325
|
-
*
|
|
3326
|
-
*
|
|
3327
|
-
*
|
|
3781
|
+
* Properties for temperature sensors
|
|
3782
|
+
*
|
|
3783
|
+
* @internal
|
|
3328
3784
|
*/
|
|
3329
|
-
|
|
3330
|
-
/**
|
|
3331
|
-
|
|
3332
|
-
/** Sensor name (stable across restarts) */
|
|
3333
|
-
sensorName: string;
|
|
3334
|
-
/** Plugin ID that provides this sensor */
|
|
3335
|
-
pluginId: string;
|
|
3785
|
+
declare enum TemperatureProperty {
|
|
3786
|
+
/** Current temperature in degrees Celsius */
|
|
3787
|
+
Current = "current"
|
|
3336
3788
|
}
|
|
3337
3789
|
/**
|
|
3338
|
-
*
|
|
3790
|
+
* Property value map for temperature info sensors.
|
|
3791
|
+
*
|
|
3792
|
+
* @internal
|
|
3339
3793
|
*/
|
|
3340
|
-
interface
|
|
3341
|
-
|
|
3342
|
-
timeout: number;
|
|
3343
|
-
/** Sensors that also trigger the detection cascade (in addition to motion/audio) */
|
|
3344
|
-
triggers: SensorTriggerRef[];
|
|
3794
|
+
interface TemperatureInfoProperties {
|
|
3795
|
+
[TemperatureProperty.Current]: number;
|
|
3345
3796
|
}
|
|
3346
|
-
/**
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
/**
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3797
|
+
/** Read-only proxy interface for a temperature sensor */
|
|
3798
|
+
interface TemperatureInfoLike extends SensorLike {
|
|
3799
|
+
readonly type: SensorType.Temperature;
|
|
3800
|
+
readonly onPropertyChanged: Observable<PropertyChangeOf<TemperatureInfoProperties>>;
|
|
3801
|
+
getValue(property: TemperatureProperty.Current): number | undefined;
|
|
3802
|
+
getValue(property: string): unknown;
|
|
3803
|
+
}
|
|
3804
|
+
/** Temperature info sensor. Reports current temperature in °C. */
|
|
3805
|
+
declare class TemperatureInfo<TStorage extends object = Record<string, any>> extends Sensor<TemperatureInfoProperties, TStorage> {
|
|
3806
|
+
readonly type = SensorType.Temperature;
|
|
3807
|
+
readonly category = SensorCategory.Info;
|
|
3808
|
+
constructor(name?: string);
|
|
3809
|
+
get current(): number;
|
|
3810
|
+
/**
|
|
3811
|
+
* Report a new temperature reading. Clamped to [-270, 100] °C.
|
|
3812
|
+
*
|
|
3813
|
+
* @param value - Temperature reading in degrees Celsius.
|
|
3814
|
+
*
|
|
3815
|
+
* @example
|
|
3816
|
+
* ```ts
|
|
3817
|
+
* temperature.setCurrent(21.5);
|
|
3818
|
+
* ```
|
|
3819
|
+
*/
|
|
3820
|
+
setCurrent(value: number): void;
|
|
3821
|
+
/**
|
|
3822
|
+
* Read-only sensor: external writes are ignored. Reading via `setCurrent` is plugin-only.
|
|
3823
|
+
*
|
|
3824
|
+
* Called by the cross-process plugin host when a generic property write is received.
|
|
3825
|
+
* Temperature sensors have no externally writable properties, so the parameters are
|
|
3826
|
+
* unused (underscore-prefixed) and the call is a no-op.
|
|
3827
|
+
*
|
|
3828
|
+
* @param _property - Unused — temperature sensors expose no writable properties.
|
|
3829
|
+
*
|
|
3830
|
+
* @param _value - Unused — temperature sensors expose no writable properties.
|
|
3831
|
+
*
|
|
3832
|
+
* @internal
|
|
3833
|
+
*/
|
|
3834
|
+
updateValue(_property: string, _value: unknown): void;
|
|
3363
3835
|
}
|
|
3836
|
+
/** Registry metadata for {@link TemperatureInfo}. */
|
|
3837
|
+
declare const temperatureMeta: {
|
|
3838
|
+
readonly type: SensorType.Temperature;
|
|
3839
|
+
readonly category: SensorCategory.Info;
|
|
3840
|
+
readonly assignmentKey: "temperature";
|
|
3841
|
+
readonly multiProvider: true;
|
|
3842
|
+
readonly isDetectionType: false;
|
|
3843
|
+
readonly properties: TemperatureProperty.Current[];
|
|
3844
|
+
readonly shortcutable: true;
|
|
3845
|
+
readonly virtual: {
|
|
3846
|
+
readonly properties: {
|
|
3847
|
+
readonly current: 20;
|
|
3848
|
+
};
|
|
3849
|
+
};
|
|
3850
|
+
readonly semantics: {
|
|
3851
|
+
readonly domain: SensorDomain.Measurement;
|
|
3852
|
+
readonly stateProperty: TemperatureProperty;
|
|
3853
|
+
readonly commandProperty: TemperatureProperty;
|
|
3854
|
+
readonly deviceClass: "temperature";
|
|
3855
|
+
readonly unit: "°C";
|
|
3856
|
+
};
|
|
3857
|
+
};
|
|
3858
|
+
|
|
3364
3859
|
/**
|
|
3365
|
-
*
|
|
3366
|
-
*
|
|
3860
|
+
* Property names of a classifier sensor.
|
|
3861
|
+
*
|
|
3862
|
+
* @internal
|
|
3367
3863
|
*/
|
|
3368
|
-
|
|
3369
|
-
/**
|
|
3370
|
-
|
|
3371
|
-
/**
|
|
3372
|
-
|
|
3373
|
-
/**
|
|
3864
|
+
declare enum ClassifierProperty {
|
|
3865
|
+
/** Whether any classification result is active. */
|
|
3866
|
+
Detected = "detected",
|
|
3867
|
+
/** List of classification results with labels and confidence. */
|
|
3868
|
+
Detections = "detections",
|
|
3869
|
+
/** Unique labels of the current detections (auto-derived when reporting detections). */
|
|
3870
|
+
Labels = "labels"
|
|
3871
|
+
}
|
|
3872
|
+
/** A classifier detection result with an open attribute for classifier categories. */
|
|
3873
|
+
interface ClassifierDetection extends Detection {
|
|
3874
|
+
/** Classifier category (e.g. `'bird'`, `'delivery'`). Open string for any classifier. */
|
|
3875
|
+
attribute: string;
|
|
3876
|
+
/** Classifier sub-category (e.g. `'woodpecker'`, `'amazon'`). */
|
|
3877
|
+
subAttribute: string;
|
|
3878
|
+
}
|
|
3879
|
+
/**
|
|
3880
|
+
* Property shape carried by a {@link ClassifierSensor}.
|
|
3881
|
+
*
|
|
3882
|
+
* @internal
|
|
3883
|
+
*/
|
|
3884
|
+
interface ClassifierSensorProperties {
|
|
3885
|
+
[ClassifierProperty.Detected]: boolean;
|
|
3886
|
+
[ClassifierProperty.Detections]: ClassifierDetection[];
|
|
3887
|
+
[ClassifierProperty.Labels]: string[];
|
|
3888
|
+
}
|
|
3889
|
+
/** Read-only proxy interface for a classifier sensor. */
|
|
3890
|
+
interface ClassifierSensorLike extends SensorLike {
|
|
3891
|
+
/** Sensor type discriminant. */
|
|
3892
|
+
readonly type: SensorType.Classifier;
|
|
3893
|
+
/** Property change observable narrowed to classifier properties. */
|
|
3894
|
+
readonly onPropertyChanged: Observable<PropertyChangeOf<ClassifierSensorProperties>>;
|
|
3895
|
+
getValue(property: ClassifierProperty.Detected): boolean | undefined;
|
|
3896
|
+
getValue(property: ClassifierProperty.Detections): ClassifierDetection[] | undefined;
|
|
3897
|
+
getValue(property: ClassifierProperty.Labels): string[] | undefined;
|
|
3898
|
+
getValue(property: string): unknown;
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3901
|
+
* General-purpose image classifier sensor.
|
|
3902
|
+
*
|
|
3903
|
+
* Plugin authors call `reportDetections(list)` to push classification results.
|
|
3904
|
+
* `detected` and `labels` are auto-derived from the detection list.
|
|
3905
|
+
*/
|
|
3906
|
+
declare class ClassifierSensor<TStorage extends object = Record<string, any>> extends Sensor<ClassifierSensorProperties, TStorage> {
|
|
3907
|
+
readonly type = SensorType.Classifier;
|
|
3908
|
+
readonly category = SensorCategory.Sensor;
|
|
3909
|
+
_requiresFrames: boolean;
|
|
3910
|
+
constructor(name?: string);
|
|
3911
|
+
/** Whether any classification result is active. */
|
|
3912
|
+
get detected(): boolean;
|
|
3913
|
+
/** Current detection list. */
|
|
3914
|
+
get detections(): ClassifierDetection[];
|
|
3915
|
+
/** Unique labels of the current detections. */
|
|
3916
|
+
get labels(): string[];
|
|
3917
|
+
/**
|
|
3918
|
+
* Report classification results. Auto-derives `detected` and `labels` from the list.
|
|
3919
|
+
*
|
|
3920
|
+
* - `reportDetections(true)` — generic classification trigger. The SDK
|
|
3921
|
+
* synthesizes a single full-frame detection with empty attribute/subAttribute.
|
|
3922
|
+
* - `reportDetections(true, [...])` — explicit classifier detections.
|
|
3923
|
+
* - `reportDetections(false)` — clear.
|
|
3924
|
+
*
|
|
3925
|
+
* @param detected - Whether any classification result is active.
|
|
3926
|
+
*
|
|
3927
|
+
* @param detections - Optional explicit classifier detections to publish.
|
|
3928
|
+
*
|
|
3929
|
+
* @example
|
|
3930
|
+
* ```ts
|
|
3931
|
+
* import type { ClassifierDetection } from '@camera.ui/sdk';
|
|
3932
|
+
* sensor.reportDetections(true, [
|
|
3933
|
+
* {
|
|
3934
|
+
* label: 'animal',
|
|
3935
|
+
* confidence: 0.88,
|
|
3936
|
+
* box: { x: 0.1, y: 0.2, width: 0.3, height: 0.4 },
|
|
3937
|
+
* attribute: 'bird',
|
|
3938
|
+
* subAttribute: 'woodpecker',
|
|
3939
|
+
* } satisfies ClassifierDetection,
|
|
3940
|
+
* ]);
|
|
3941
|
+
* sensor.reportDetections(false);
|
|
3942
|
+
* ```
|
|
3943
|
+
*/
|
|
3944
|
+
reportDetections(detected: boolean, detections?: ClassifierDetection[]): void;
|
|
3945
|
+
/**
|
|
3946
|
+
* Explicitly clear classifier state (detected = false, detections = [], labels = []).
|
|
3947
|
+
*
|
|
3948
|
+
* @example
|
|
3949
|
+
* ```ts
|
|
3950
|
+
* sensor.clearDetections();
|
|
3951
|
+
* ```
|
|
3952
|
+
*/
|
|
3953
|
+
clearDetections(): void;
|
|
3954
|
+
/**
|
|
3955
|
+
* Read-only sensor: external writes are ignored. State is reported via `reportDetections`.
|
|
3956
|
+
*
|
|
3957
|
+
* Called by the cross-process plugin host when a generic property write is received.
|
|
3958
|
+
* Classifier sensors have no externally writable properties, so the parameters are
|
|
3959
|
+
* unused (underscore-prefixed) and the call is a no-op.
|
|
3960
|
+
*
|
|
3961
|
+
* @param _property - Unused — classifier sensors expose no writable properties.
|
|
3962
|
+
*
|
|
3963
|
+
* @param _value - Unused — classifier sensors expose no writable properties.
|
|
3964
|
+
*
|
|
3965
|
+
* @internal
|
|
3966
|
+
*/
|
|
3967
|
+
updateValue(_property: string, _value: unknown): void;
|
|
3968
|
+
}
|
|
3969
|
+
/** Return type for {@link ClassifierDetectorSensor.detectClassifications}. */
|
|
3970
|
+
interface ClassifierResult {
|
|
3971
|
+
/** Whether any classification result is emitted for this frame. */
|
|
3972
|
+
detected: boolean;
|
|
3973
|
+
/** Detections emitted for this frame. */
|
|
3974
|
+
detections: ClassifierDetection[];
|
|
3975
|
+
}
|
|
3976
|
+
/**
|
|
3977
|
+
* Classifier detector that receives video frames from the backend pipeline.
|
|
3978
|
+
* Extend this class and implement {@link detectClassifications} to run image
|
|
3979
|
+
* classification models against trigger regions.
|
|
3980
|
+
*/
|
|
3981
|
+
declare abstract class ClassifierDetectorSensor<TStorage extends object = Record<string, any>> extends ClassifierSensor<TStorage> {
|
|
3982
|
+
_requiresFrames: boolean;
|
|
3983
|
+
/** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
|
|
3984
|
+
abstract get modelSpec(): ModelSpec;
|
|
3985
|
+
/**
|
|
3986
|
+
* Classify frames in batch. Each frame is a pre-cropped, pre-scaled
|
|
3987
|
+
* trigger region produced by the upstream object detector. Must return
|
|
3988
|
+
* exactly one ClassifierResult per input frame, in the same order.
|
|
3989
|
+
*/
|
|
3990
|
+
abstract detectClassifications(frames: VideoFrameData[]): Promise<ClassifierResult[]>;
|
|
3991
|
+
}
|
|
3992
|
+
/** Registry metadata for {@link ClassifierSensor}. */
|
|
3993
|
+
declare const classifierMeta: {
|
|
3994
|
+
readonly type: SensorType.Classifier;
|
|
3995
|
+
readonly category: SensorCategory.Sensor;
|
|
3996
|
+
readonly assignmentKey: "classifier";
|
|
3997
|
+
readonly multiProvider: true;
|
|
3998
|
+
readonly isDetectionType: true;
|
|
3999
|
+
readonly properties: ClassifierProperty[];
|
|
4000
|
+
readonly semantics: null;
|
|
4001
|
+
};
|
|
4002
|
+
|
|
4003
|
+
/** Every sensor's metadata. A new sensor type adds its meta here. */
|
|
4004
|
+
declare const SENSOR_META: readonly [{
|
|
4005
|
+
readonly type: SensorType.Audio;
|
|
4006
|
+
readonly category: SensorCategory.Sensor;
|
|
4007
|
+
readonly assignmentKey: "audio";
|
|
4008
|
+
readonly multiProvider: false;
|
|
4009
|
+
readonly isDetectionType: true;
|
|
4010
|
+
readonly properties: AudioProperty[];
|
|
4011
|
+
readonly semantics: null;
|
|
4012
|
+
}, {
|
|
4013
|
+
readonly type: SensorType.Battery;
|
|
4014
|
+
readonly category: SensorCategory.Info;
|
|
4015
|
+
readonly assignmentKey: "battery";
|
|
4016
|
+
readonly multiProvider: false;
|
|
4017
|
+
readonly isDetectionType: false;
|
|
4018
|
+
readonly properties: BatteryProperty[];
|
|
4019
|
+
readonly shortcutable: true;
|
|
4020
|
+
readonly propertyCapabilities: {
|
|
4021
|
+
readonly charging: BatteryCapability.Charging;
|
|
4022
|
+
readonly low: BatteryCapability.LowBattery;
|
|
4023
|
+
};
|
|
4024
|
+
readonly semantics: {
|
|
4025
|
+
readonly domain: SensorDomain.Measurement;
|
|
4026
|
+
readonly stateProperty: BatteryProperty.Level;
|
|
4027
|
+
readonly commandProperty: BatteryProperty.Level;
|
|
4028
|
+
readonly deviceClass: "battery";
|
|
4029
|
+
readonly unit: "%";
|
|
4030
|
+
readonly diagnostic: true;
|
|
4031
|
+
};
|
|
4032
|
+
}, {
|
|
4033
|
+
readonly type: SensorType.Classifier;
|
|
4034
|
+
readonly category: SensorCategory.Sensor;
|
|
4035
|
+
readonly assignmentKey: "classifier";
|
|
4036
|
+
readonly multiProvider: true;
|
|
4037
|
+
readonly isDetectionType: true;
|
|
4038
|
+
readonly properties: ClassifierProperty[];
|
|
4039
|
+
readonly semantics: null;
|
|
4040
|
+
}, {
|
|
4041
|
+
readonly type: SensorType.Clip;
|
|
4042
|
+
readonly category: SensorCategory.Sensor;
|
|
4043
|
+
readonly assignmentKey: "clip";
|
|
4044
|
+
readonly multiProvider: false;
|
|
4045
|
+
readonly isDetectionType: true;
|
|
4046
|
+
readonly properties: readonly [];
|
|
4047
|
+
readonly semantics: null;
|
|
4048
|
+
}, {
|
|
4049
|
+
readonly type: SensorType.Contact;
|
|
4050
|
+
readonly category: SensorCategory.Sensor;
|
|
4051
|
+
readonly assignmentKey: "contact";
|
|
4052
|
+
readonly multiProvider: true;
|
|
4053
|
+
readonly isDetectionType: false;
|
|
4054
|
+
readonly properties: ContactProperty.Detected[];
|
|
4055
|
+
readonly shortcutable: true;
|
|
4056
|
+
readonly cascadeTrigger: {
|
|
4057
|
+
readonly property: ContactProperty;
|
|
4058
|
+
readonly value: true;
|
|
4059
|
+
readonly sustained: true;
|
|
4060
|
+
};
|
|
4061
|
+
readonly virtual: {
|
|
4062
|
+
readonly properties: {
|
|
4063
|
+
readonly detected: false;
|
|
4064
|
+
};
|
|
4065
|
+
};
|
|
4066
|
+
readonly semantics: {
|
|
4067
|
+
readonly domain: SensorDomain.Binary;
|
|
4068
|
+
readonly stateProperty: ContactProperty;
|
|
4069
|
+
readonly commandProperty: ContactProperty;
|
|
4070
|
+
readonly deviceClass: "opening";
|
|
4071
|
+
};
|
|
4072
|
+
}, {
|
|
4073
|
+
readonly type: SensorType.Doorbell;
|
|
4074
|
+
readonly category: SensorCategory.Trigger;
|
|
4075
|
+
readonly assignmentKey: "doorbell";
|
|
4076
|
+
readonly multiProvider: true;
|
|
4077
|
+
readonly isDetectionType: false;
|
|
4078
|
+
readonly properties: DoorbellProperty.Ring[];
|
|
4079
|
+
readonly shortcutable: true;
|
|
4080
|
+
readonly cascadeTrigger: {
|
|
4081
|
+
readonly property: DoorbellProperty;
|
|
4082
|
+
readonly value: true;
|
|
4083
|
+
readonly sustained: false;
|
|
4084
|
+
};
|
|
4085
|
+
readonly virtual: {
|
|
4086
|
+
readonly properties: {
|
|
4087
|
+
readonly ring: false;
|
|
4088
|
+
};
|
|
4089
|
+
};
|
|
4090
|
+
readonly semantics: {
|
|
4091
|
+
readonly domain: SensorDomain.Binary;
|
|
4092
|
+
readonly stateProperty: DoorbellProperty;
|
|
4093
|
+
readonly commandProperty: DoorbellProperty;
|
|
4094
|
+
readonly icon: "mdi:doorbell";
|
|
4095
|
+
};
|
|
4096
|
+
}, {
|
|
4097
|
+
readonly type: SensorType.Face;
|
|
4098
|
+
readonly category: SensorCategory.Sensor;
|
|
4099
|
+
readonly assignmentKey: "face";
|
|
4100
|
+
readonly multiProvider: false;
|
|
4101
|
+
readonly isDetectionType: true;
|
|
4102
|
+
readonly properties: FaceProperty[];
|
|
4103
|
+
readonly semantics: null;
|
|
4104
|
+
}, {
|
|
4105
|
+
readonly type: SensorType.Garage;
|
|
4106
|
+
readonly category: SensorCategory.Control;
|
|
4107
|
+
readonly assignmentKey: "garage";
|
|
4108
|
+
readonly multiProvider: true;
|
|
4109
|
+
readonly isDetectionType: false;
|
|
4110
|
+
readonly properties: GarageProperty[];
|
|
4111
|
+
readonly shortcutable: true;
|
|
4112
|
+
readonly cascadeTrigger: {
|
|
4113
|
+
readonly property: GarageProperty.CurrentState;
|
|
4114
|
+
readonly value: 0;
|
|
4115
|
+
readonly sustained: true;
|
|
4116
|
+
};
|
|
4117
|
+
readonly virtual: {
|
|
4118
|
+
readonly properties: {
|
|
4119
|
+
readonly currentState: 1;
|
|
4120
|
+
readonly targetState: 1;
|
|
4121
|
+
};
|
|
4122
|
+
};
|
|
4123
|
+
readonly semantics: {
|
|
4124
|
+
readonly domain: SensorDomain.Cover;
|
|
4125
|
+
readonly stateProperty: GarageProperty.CurrentState;
|
|
4126
|
+
readonly commandProperty: GarageProperty.TargetState;
|
|
4127
|
+
readonly deviceClass: "garage";
|
|
4128
|
+
readonly states: {
|
|
4129
|
+
readonly open: GarageState.Open;
|
|
4130
|
+
readonly closed: GarageState.Closed;
|
|
4131
|
+
readonly opening: GarageState.Opening;
|
|
4132
|
+
readonly closing: GarageState.Closing;
|
|
4133
|
+
readonly stopped: GarageState.Stopped;
|
|
4134
|
+
};
|
|
4135
|
+
};
|
|
4136
|
+
}, {
|
|
4137
|
+
readonly type: SensorType.Humidity;
|
|
4138
|
+
readonly category: SensorCategory.Info;
|
|
4139
|
+
readonly assignmentKey: "humidity";
|
|
4140
|
+
readonly multiProvider: true;
|
|
4141
|
+
readonly isDetectionType: false;
|
|
4142
|
+
readonly properties: HumidityProperty.Current[];
|
|
4143
|
+
readonly shortcutable: true;
|
|
4144
|
+
readonly virtual: {
|
|
4145
|
+
readonly properties: {
|
|
4146
|
+
readonly current: 50;
|
|
4147
|
+
};
|
|
4148
|
+
};
|
|
4149
|
+
readonly semantics: {
|
|
4150
|
+
readonly domain: SensorDomain.Measurement;
|
|
4151
|
+
readonly stateProperty: HumidityProperty;
|
|
4152
|
+
readonly commandProperty: HumidityProperty;
|
|
4153
|
+
readonly deviceClass: "humidity";
|
|
4154
|
+
readonly unit: "%";
|
|
4155
|
+
};
|
|
4156
|
+
}, {
|
|
4157
|
+
readonly type: SensorType.Leak;
|
|
4158
|
+
readonly category: SensorCategory.Sensor;
|
|
4159
|
+
readonly assignmentKey: "leak";
|
|
4160
|
+
readonly multiProvider: true;
|
|
4161
|
+
readonly isDetectionType: false;
|
|
4162
|
+
readonly properties: LeakProperty.Detected[];
|
|
4163
|
+
readonly shortcutable: true;
|
|
4164
|
+
readonly cascadeTrigger: {
|
|
4165
|
+
readonly property: LeakProperty;
|
|
4166
|
+
readonly value: true;
|
|
4167
|
+
readonly sustained: true;
|
|
4168
|
+
};
|
|
4169
|
+
readonly virtual: {
|
|
4170
|
+
readonly properties: {
|
|
4171
|
+
readonly detected: false;
|
|
4172
|
+
};
|
|
4173
|
+
};
|
|
4174
|
+
readonly semantics: {
|
|
4175
|
+
readonly domain: SensorDomain.Binary;
|
|
4176
|
+
readonly stateProperty: LeakProperty;
|
|
4177
|
+
readonly commandProperty: LeakProperty;
|
|
4178
|
+
readonly deviceClass: "moisture";
|
|
4179
|
+
};
|
|
4180
|
+
}, {
|
|
4181
|
+
readonly type: SensorType.LicensePlate;
|
|
4182
|
+
readonly category: SensorCategory.Sensor;
|
|
4183
|
+
readonly assignmentKey: "licensePlate";
|
|
4184
|
+
readonly multiProvider: false;
|
|
4185
|
+
readonly isDetectionType: true;
|
|
4186
|
+
readonly properties: LicensePlateProperty[];
|
|
4187
|
+
readonly semantics: null;
|
|
4188
|
+
}, {
|
|
4189
|
+
readonly type: SensorType.Light;
|
|
4190
|
+
readonly category: SensorCategory.Control;
|
|
4191
|
+
readonly assignmentKey: "light";
|
|
4192
|
+
readonly multiProvider: true;
|
|
4193
|
+
readonly isDetectionType: false;
|
|
4194
|
+
readonly properties: LightProperty[];
|
|
4195
|
+
readonly shortcutable: true;
|
|
4196
|
+
readonly cascadeTrigger: {
|
|
4197
|
+
readonly property: LightProperty.On;
|
|
4198
|
+
readonly value: true;
|
|
4199
|
+
readonly sustained: true;
|
|
4200
|
+
};
|
|
4201
|
+
readonly propertyCapabilities: {
|
|
4202
|
+
readonly brightness: LightCapability;
|
|
4203
|
+
};
|
|
4204
|
+
readonly virtual: {
|
|
4205
|
+
readonly properties: {
|
|
4206
|
+
readonly on: false;
|
|
4207
|
+
readonly brightness: 100;
|
|
4208
|
+
};
|
|
4209
|
+
readonly capabilities: readonly [LightCapability];
|
|
4210
|
+
};
|
|
4211
|
+
readonly semantics: {
|
|
4212
|
+
readonly domain: SensorDomain.Light;
|
|
4213
|
+
readonly stateProperty: LightProperty.On;
|
|
4214
|
+
readonly commandProperty: LightProperty.On;
|
|
4215
|
+
};
|
|
4216
|
+
}, {
|
|
4217
|
+
readonly type: SensorType.Lock;
|
|
4218
|
+
readonly category: SensorCategory.Control;
|
|
4219
|
+
readonly assignmentKey: "lock";
|
|
4220
|
+
readonly multiProvider: true;
|
|
4221
|
+
readonly isDetectionType: false;
|
|
4222
|
+
readonly properties: LockProperty[];
|
|
4223
|
+
readonly shortcutable: true;
|
|
4224
|
+
readonly cascadeTrigger: {
|
|
4225
|
+
readonly property: LockProperty.CurrentState;
|
|
4226
|
+
readonly value: 1;
|
|
4227
|
+
readonly sustained: true;
|
|
4228
|
+
};
|
|
4229
|
+
readonly virtual: {
|
|
4230
|
+
readonly properties: {
|
|
4231
|
+
readonly currentState: 0;
|
|
4232
|
+
readonly targetState: 0;
|
|
4233
|
+
};
|
|
4234
|
+
};
|
|
4235
|
+
readonly semantics: {
|
|
4236
|
+
readonly domain: SensorDomain.Lock;
|
|
4237
|
+
readonly stateProperty: LockProperty.CurrentState;
|
|
4238
|
+
readonly commandProperty: LockProperty.TargetState;
|
|
4239
|
+
readonly states: {
|
|
4240
|
+
readonly locked: LockState.Secured;
|
|
4241
|
+
readonly unlocked: LockState.Unsecured;
|
|
4242
|
+
};
|
|
4243
|
+
};
|
|
4244
|
+
}, {
|
|
4245
|
+
readonly type: SensorType.Motion;
|
|
4246
|
+
readonly category: SensorCategory.Sensor;
|
|
4247
|
+
readonly assignmentKey: "motion";
|
|
4248
|
+
readonly multiProvider: false;
|
|
4249
|
+
readonly isDetectionType: true;
|
|
4250
|
+
readonly properties: MotionProperty[];
|
|
4251
|
+
readonly semantics: null;
|
|
4252
|
+
}, {
|
|
4253
|
+
readonly type: SensorType.Object;
|
|
4254
|
+
readonly category: SensorCategory.Sensor;
|
|
4255
|
+
readonly assignmentKey: "object";
|
|
4256
|
+
readonly multiProvider: false;
|
|
4257
|
+
readonly isDetectionType: true;
|
|
4258
|
+
readonly properties: ObjectProperty[];
|
|
4259
|
+
readonly semantics: null;
|
|
4260
|
+
}, {
|
|
4261
|
+
readonly type: SensorType.Occupancy;
|
|
4262
|
+
readonly category: SensorCategory.Sensor;
|
|
4263
|
+
readonly assignmentKey: "occupancy";
|
|
4264
|
+
readonly multiProvider: true;
|
|
4265
|
+
readonly isDetectionType: false;
|
|
4266
|
+
readonly properties: OccupancyProperty.Detected[];
|
|
4267
|
+
readonly shortcutable: true;
|
|
4268
|
+
readonly cascadeTrigger: {
|
|
4269
|
+
readonly property: OccupancyProperty;
|
|
4270
|
+
readonly value: true;
|
|
4271
|
+
readonly sustained: true;
|
|
4272
|
+
};
|
|
4273
|
+
readonly virtual: {
|
|
4274
|
+
readonly properties: {
|
|
4275
|
+
readonly detected: false;
|
|
4276
|
+
};
|
|
4277
|
+
};
|
|
4278
|
+
readonly semantics: {
|
|
4279
|
+
readonly domain: SensorDomain.Binary;
|
|
4280
|
+
readonly stateProperty: OccupancyProperty;
|
|
4281
|
+
readonly commandProperty: OccupancyProperty;
|
|
4282
|
+
readonly deviceClass: "occupancy";
|
|
4283
|
+
};
|
|
4284
|
+
}, {
|
|
4285
|
+
readonly type: SensorType.PTZ;
|
|
4286
|
+
readonly category: SensorCategory.Control;
|
|
4287
|
+
readonly assignmentKey: "ptz";
|
|
4288
|
+
readonly multiProvider: false;
|
|
4289
|
+
readonly isDetectionType: false;
|
|
4290
|
+
readonly properties: PTZProperty[];
|
|
4291
|
+
readonly semantics: null;
|
|
4292
|
+
}, {
|
|
4293
|
+
readonly type: SensorType.SecuritySystem;
|
|
4294
|
+
readonly category: SensorCategory.Control;
|
|
4295
|
+
readonly assignmentKey: "securitySystem";
|
|
4296
|
+
readonly multiProvider: true;
|
|
4297
|
+
readonly isDetectionType: false;
|
|
4298
|
+
readonly properties: SecuritySystemProperty[];
|
|
4299
|
+
readonly shortcutable: true;
|
|
4300
|
+
readonly cascadeTrigger: {
|
|
4301
|
+
readonly property: SecuritySystemProperty.CurrentState;
|
|
4302
|
+
readonly value: 4;
|
|
4303
|
+
readonly sustained: true;
|
|
4304
|
+
};
|
|
4305
|
+
readonly virtual: {
|
|
4306
|
+
readonly properties: {
|
|
4307
|
+
readonly currentState: 3;
|
|
4308
|
+
readonly targetState: 3;
|
|
4309
|
+
};
|
|
4310
|
+
};
|
|
4311
|
+
readonly semantics: {
|
|
4312
|
+
readonly domain: SensorDomain.Alarm;
|
|
4313
|
+
readonly stateProperty: SecuritySystemProperty.CurrentState;
|
|
4314
|
+
readonly commandProperty: SecuritySystemProperty.TargetState;
|
|
4315
|
+
readonly states: {
|
|
4316
|
+
readonly armed_home: SecuritySystemState.StayArm;
|
|
4317
|
+
readonly armed_away: SecuritySystemState.AwayArm;
|
|
4318
|
+
readonly armed_night: SecuritySystemState.NightArm;
|
|
4319
|
+
readonly disarmed: SecuritySystemState.Disarmed;
|
|
4320
|
+
readonly triggered: SecuritySystemState.AlarmTriggered;
|
|
4321
|
+
};
|
|
4322
|
+
};
|
|
4323
|
+
}, {
|
|
4324
|
+
readonly type: SensorType.Siren;
|
|
4325
|
+
readonly category: SensorCategory.Control;
|
|
4326
|
+
readonly assignmentKey: "siren";
|
|
4327
|
+
readonly multiProvider: true;
|
|
4328
|
+
readonly isDetectionType: false;
|
|
4329
|
+
readonly properties: SirenProperty[];
|
|
4330
|
+
readonly shortcutable: true;
|
|
4331
|
+
readonly cascadeTrigger: {
|
|
4332
|
+
readonly property: SirenProperty.Active;
|
|
4333
|
+
readonly value: true;
|
|
4334
|
+
readonly sustained: true;
|
|
4335
|
+
};
|
|
4336
|
+
readonly propertyCapabilities: {
|
|
4337
|
+
readonly volume: SirenCapability;
|
|
4338
|
+
};
|
|
4339
|
+
readonly virtual: {
|
|
4340
|
+
readonly properties: {
|
|
4341
|
+
readonly active: false;
|
|
4342
|
+
readonly volume: 100;
|
|
4343
|
+
};
|
|
4344
|
+
readonly capabilities: readonly [SirenCapability];
|
|
4345
|
+
};
|
|
4346
|
+
readonly semantics: {
|
|
4347
|
+
readonly domain: SensorDomain.Siren;
|
|
4348
|
+
readonly stateProperty: SirenProperty.Active;
|
|
4349
|
+
readonly commandProperty: SirenProperty.Active;
|
|
4350
|
+
};
|
|
4351
|
+
}, {
|
|
4352
|
+
readonly type: SensorType.Smoke;
|
|
4353
|
+
readonly category: SensorCategory.Sensor;
|
|
4354
|
+
readonly assignmentKey: "smoke";
|
|
4355
|
+
readonly multiProvider: true;
|
|
4356
|
+
readonly isDetectionType: false;
|
|
4357
|
+
readonly properties: SmokeProperty.Detected[];
|
|
4358
|
+
readonly shortcutable: true;
|
|
4359
|
+
readonly cascadeTrigger: {
|
|
4360
|
+
readonly property: SmokeProperty;
|
|
4361
|
+
readonly value: true;
|
|
4362
|
+
readonly sustained: true;
|
|
4363
|
+
};
|
|
4364
|
+
readonly virtual: {
|
|
4365
|
+
readonly properties: {
|
|
4366
|
+
readonly detected: false;
|
|
4367
|
+
};
|
|
4368
|
+
};
|
|
4369
|
+
readonly semantics: {
|
|
4370
|
+
readonly domain: SensorDomain.Binary;
|
|
4371
|
+
readonly stateProperty: SmokeProperty;
|
|
4372
|
+
readonly commandProperty: SmokeProperty;
|
|
4373
|
+
readonly deviceClass: "smoke";
|
|
4374
|
+
};
|
|
4375
|
+
}, {
|
|
4376
|
+
readonly type: SensorType.Switch;
|
|
4377
|
+
readonly category: SensorCategory.Control;
|
|
4378
|
+
readonly assignmentKey: "switch";
|
|
4379
|
+
readonly multiProvider: true;
|
|
4380
|
+
readonly isDetectionType: false;
|
|
4381
|
+
readonly properties: SwitchProperty.On[];
|
|
4382
|
+
readonly shortcutable: true;
|
|
4383
|
+
readonly cascadeTrigger: {
|
|
4384
|
+
readonly property: SwitchProperty;
|
|
4385
|
+
readonly value: true;
|
|
4386
|
+
readonly sustained: true;
|
|
4387
|
+
};
|
|
4388
|
+
readonly virtual: {
|
|
4389
|
+
readonly properties: {
|
|
4390
|
+
readonly on: false;
|
|
4391
|
+
};
|
|
4392
|
+
};
|
|
4393
|
+
readonly semantics: {
|
|
4394
|
+
readonly domain: SensorDomain.Switch;
|
|
4395
|
+
readonly stateProperty: SwitchProperty;
|
|
4396
|
+
readonly commandProperty: SwitchProperty;
|
|
4397
|
+
};
|
|
4398
|
+
}, {
|
|
4399
|
+
readonly type: SensorType.Temperature;
|
|
4400
|
+
readonly category: SensorCategory.Info;
|
|
4401
|
+
readonly assignmentKey: "temperature";
|
|
4402
|
+
readonly multiProvider: true;
|
|
4403
|
+
readonly isDetectionType: false;
|
|
4404
|
+
readonly properties: TemperatureProperty.Current[];
|
|
4405
|
+
readonly shortcutable: true;
|
|
4406
|
+
readonly virtual: {
|
|
4407
|
+
readonly properties: {
|
|
4408
|
+
readonly current: 20;
|
|
4409
|
+
};
|
|
4410
|
+
};
|
|
4411
|
+
readonly semantics: {
|
|
4412
|
+
readonly domain: SensorDomain.Measurement;
|
|
4413
|
+
readonly stateProperty: TemperatureProperty;
|
|
4414
|
+
readonly commandProperty: TemperatureProperty;
|
|
4415
|
+
readonly deviceClass: "temperature";
|
|
4416
|
+
readonly unit: "°C";
|
|
4417
|
+
};
|
|
4418
|
+
}];
|
|
4419
|
+
/** Union of every declared assignment key, derived from the registry. */
|
|
4420
|
+
type SensorAssignmentKey = (typeof SENSOR_META)[number]['assignmentKey'];
|
|
4421
|
+
/**
|
|
4422
|
+
* Looks up a sensor's metadata by its type.
|
|
4423
|
+
*
|
|
4424
|
+
* @param type - The sensor type value.
|
|
4425
|
+
*
|
|
4426
|
+
* @returns The metadata, or `undefined` if no sensor declares that type.
|
|
4427
|
+
*
|
|
4428
|
+
* @example
|
|
4429
|
+
* ```ts
|
|
4430
|
+
* const meta = sensorMeta(SensorType.Light);
|
|
4431
|
+
* ```
|
|
4432
|
+
*/
|
|
4433
|
+
declare function sensorMeta(type: string): SensorMeta | undefined;
|
|
4434
|
+
|
|
4435
|
+
/**
|
|
4436
|
+
* Stable reference to a sensor for cascade trigger configuration.
|
|
4437
|
+
* Uses composite key (sensorType + sensorName + pluginId) instead of UUID
|
|
4438
|
+
* so references survive plugin restarts.
|
|
4439
|
+
*/
|
|
4440
|
+
interface SensorTriggerRef {
|
|
4441
|
+
/** Sensor type (e.g. 'contact', 'doorbell') */
|
|
4442
|
+
sensorType: SensorType;
|
|
4443
|
+
/** Sensor name (stable across restarts) */
|
|
4444
|
+
sensorName: string;
|
|
4445
|
+
/** Plugin ID that provides this sensor */
|
|
4446
|
+
pluginId: string;
|
|
4447
|
+
}
|
|
4448
|
+
/**
|
|
4449
|
+
* Sensor trigger settings (contact, doorbell, switch, light, etc.).
|
|
4450
|
+
*/
|
|
4451
|
+
interface SensorTriggerSettings {
|
|
4452
|
+
/** Sensor trigger timeout in seconds */
|
|
4453
|
+
timeout: number;
|
|
4454
|
+
/** Sensors that also trigger the detection cascade (in addition to motion/audio) */
|
|
4455
|
+
triggers: SensorTriggerRef[];
|
|
4456
|
+
}
|
|
4457
|
+
/**
|
|
4458
|
+
* Detection line configuration.
|
|
4459
|
+
* Defines a virtual tripwire for line crossing detection.
|
|
4460
|
+
* The two points define grab-handle positions; the actual crossing line
|
|
4461
|
+
* is perpendicular through their midpoint.
|
|
4462
|
+
*/
|
|
4463
|
+
interface DetectionLine {
|
|
4464
|
+
/** Line display name */
|
|
4465
|
+
name: string;
|
|
4466
|
+
/** Grab-handle positions (0–100%). Crossing line is perpendicular through midpoint. */
|
|
4467
|
+
points: [Point, Point];
|
|
4468
|
+
/** Which crossing direction(s) trigger events */
|
|
4469
|
+
direction: LineDirection;
|
|
4470
|
+
/** Labels to filter (empty = all labels) */
|
|
4471
|
+
labels: DetectionLabel[];
|
|
4472
|
+
/** Line display color (hex) */
|
|
4473
|
+
color: string;
|
|
4474
|
+
}
|
|
4475
|
+
/**
|
|
4476
|
+
* Detection zone configuration.
|
|
4477
|
+
* Defines areas that restrict or drop detections.
|
|
4478
|
+
*/
|
|
4479
|
+
interface DetectionZone {
|
|
4480
|
+
/** Zone display name */
|
|
4481
|
+
name: string;
|
|
4482
|
+
/** Polygon points (0-100 percentage coordinates) */
|
|
4483
|
+
points: Point[];
|
|
4484
|
+
/** Intersection detection type */
|
|
3374
4485
|
type: ZoneType;
|
|
3375
4486
|
/** Include/exclude filter mode */
|
|
3376
4487
|
filter: ZoneFilter;
|
|
@@ -3999,38 +5110,24 @@ interface AssignedPlugin {
|
|
|
3999
5110
|
/** Plugin display name */
|
|
4000
5111
|
name: string;
|
|
4001
5112
|
}
|
|
4002
|
-
/**
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
/** PTZ control plugin */
|
|
4018
|
-
ptz?: AssignedPlugin;
|
|
4019
|
-
/** Battery info plugin */
|
|
4020
|
-
battery?: AssignedPlugin;
|
|
4021
|
-
/** Camera controller plugin */
|
|
5113
|
+
/** @internal */
|
|
5114
|
+
type SingleProviderAssignmentKey = Extract<(typeof SENSOR_META)[number], {
|
|
5115
|
+
multiProvider: false;
|
|
5116
|
+
}>['assignmentKey'];
|
|
5117
|
+
/** @internal */
|
|
5118
|
+
type MultiProviderAssignmentKey = Extract<(typeof SENSOR_META)[number], {
|
|
5119
|
+
multiProvider: true;
|
|
5120
|
+
}>['assignmentKey'];
|
|
5121
|
+
/**
|
|
5122
|
+
* Plugin assignments for a camera, keyed by the assignment keys the SDK sensor
|
|
5123
|
+
* registry declares. Single-provider sensors and the camera controller hold one
|
|
5124
|
+
* plugin; multi-provider sensors and the hub hold an array. Derived from the
|
|
5125
|
+
* registry so a new sensor type gains its assignment slot automatically.
|
|
5126
|
+
*/
|
|
5127
|
+
type PluginAssignments = Partial<Record<SingleProviderAssignmentKey, AssignedPlugin>> & Partial<Record<MultiProviderAssignmentKey, AssignedPlugin[]>> & {
|
|
4022
5128
|
cameraController?: AssignedPlugin;
|
|
4023
|
-
/** Light control plugins */
|
|
4024
|
-
light?: AssignedPlugin[];
|
|
4025
|
-
/** Siren control plugins */
|
|
4026
|
-
siren?: AssignedPlugin[];
|
|
4027
|
-
/** Contact sensor plugins */
|
|
4028
|
-
contact?: AssignedPlugin[];
|
|
4029
|
-
/** Doorbell trigger plugins */
|
|
4030
|
-
doorbell?: AssignedPlugin[];
|
|
4031
|
-
/** Hub/bridge plugins */
|
|
4032
5129
|
hub?: AssignedPlugin[];
|
|
4033
|
-
}
|
|
5130
|
+
};
|
|
4034
5131
|
/**
|
|
4035
5132
|
* Camera source plugin information.
|
|
4036
5133
|
*/
|
|
@@ -4676,140 +5773,6 @@ interface PluginInfo {
|
|
|
4676
5773
|
contract: PluginContract;
|
|
4677
5774
|
}
|
|
4678
5775
|
|
|
4679
|
-
/**
|
|
4680
|
-
* Property names of a classifier sensor.
|
|
4681
|
-
*
|
|
4682
|
-
* @internal
|
|
4683
|
-
*/
|
|
4684
|
-
declare enum ClassifierProperty {
|
|
4685
|
-
/** Whether any classification result is active. */
|
|
4686
|
-
Detected = "detected",
|
|
4687
|
-
/** List of classification results with labels and confidence. */
|
|
4688
|
-
Detections = "detections",
|
|
4689
|
-
/** Unique labels of the current detections (auto-derived when reporting detections). */
|
|
4690
|
-
Labels = "labels"
|
|
4691
|
-
}
|
|
4692
|
-
/** A classifier detection result with an open attribute for classifier categories. */
|
|
4693
|
-
interface ClassifierDetection extends Detection {
|
|
4694
|
-
/** Classifier category (e.g. `'bird'`, `'delivery'`). Open string for any classifier. */
|
|
4695
|
-
attribute: string;
|
|
4696
|
-
/** Classifier sub-category (e.g. `'woodpecker'`, `'amazon'`). */
|
|
4697
|
-
subAttribute: string;
|
|
4698
|
-
}
|
|
4699
|
-
/**
|
|
4700
|
-
* Property shape carried by a {@link ClassifierSensor}.
|
|
4701
|
-
*
|
|
4702
|
-
* @internal
|
|
4703
|
-
*/
|
|
4704
|
-
interface ClassifierSensorProperties {
|
|
4705
|
-
[ClassifierProperty.Detected]: boolean;
|
|
4706
|
-
[ClassifierProperty.Detections]: ClassifierDetection[];
|
|
4707
|
-
[ClassifierProperty.Labels]: string[];
|
|
4708
|
-
}
|
|
4709
|
-
/** Read-only proxy interface for a classifier sensor. */
|
|
4710
|
-
interface ClassifierSensorLike extends SensorLike {
|
|
4711
|
-
/** Sensor type discriminant. */
|
|
4712
|
-
readonly type: SensorType.Classifier;
|
|
4713
|
-
/** Property change observable narrowed to classifier properties. */
|
|
4714
|
-
readonly onPropertyChanged: Observable<PropertyChangeOf<ClassifierSensorProperties>>;
|
|
4715
|
-
getValue(property: ClassifierProperty.Detected): boolean | undefined;
|
|
4716
|
-
getValue(property: ClassifierProperty.Detections): ClassifierDetection[] | undefined;
|
|
4717
|
-
getValue(property: ClassifierProperty.Labels): string[] | undefined;
|
|
4718
|
-
getValue(property: string): unknown;
|
|
4719
|
-
}
|
|
4720
|
-
/**
|
|
4721
|
-
* General-purpose image classifier sensor.
|
|
4722
|
-
*
|
|
4723
|
-
* Plugin authors call `reportDetections(list)` to push classification results.
|
|
4724
|
-
* `detected` and `labels` are auto-derived from the detection list.
|
|
4725
|
-
*/
|
|
4726
|
-
declare class ClassifierSensor<TStorage extends object = Record<string, any>> extends Sensor<ClassifierSensorProperties, TStorage> {
|
|
4727
|
-
readonly type = SensorType.Classifier;
|
|
4728
|
-
readonly category = SensorCategory.Sensor;
|
|
4729
|
-
_requiresFrames: boolean;
|
|
4730
|
-
constructor(name?: string);
|
|
4731
|
-
/** Whether any classification result is active. */
|
|
4732
|
-
get detected(): boolean;
|
|
4733
|
-
/** Current detection list. */
|
|
4734
|
-
get detections(): ClassifierDetection[];
|
|
4735
|
-
/** Unique labels of the current detections. */
|
|
4736
|
-
get labels(): string[];
|
|
4737
|
-
/**
|
|
4738
|
-
* Report classification results. Auto-derives `detected` and `labels` from the list.
|
|
4739
|
-
*
|
|
4740
|
-
* - `reportDetections(true)` — generic classification trigger. The SDK
|
|
4741
|
-
* synthesizes a single full-frame detection with empty attribute/subAttribute.
|
|
4742
|
-
* - `reportDetections(true, [...])` — explicit classifier detections.
|
|
4743
|
-
* - `reportDetections(false)` — clear.
|
|
4744
|
-
*
|
|
4745
|
-
* @param detected - Whether any classification result is active.
|
|
4746
|
-
*
|
|
4747
|
-
* @param detections - Optional explicit classifier detections to publish.
|
|
4748
|
-
*
|
|
4749
|
-
* @example
|
|
4750
|
-
* ```ts
|
|
4751
|
-
* import type { ClassifierDetection } from '@camera.ui/sdk';
|
|
4752
|
-
* sensor.reportDetections(true, [
|
|
4753
|
-
* {
|
|
4754
|
-
* label: 'animal',
|
|
4755
|
-
* confidence: 0.88,
|
|
4756
|
-
* box: { x: 0.1, y: 0.2, width: 0.3, height: 0.4 },
|
|
4757
|
-
* attribute: 'bird',
|
|
4758
|
-
* subAttribute: 'woodpecker',
|
|
4759
|
-
* } satisfies ClassifierDetection,
|
|
4760
|
-
* ]);
|
|
4761
|
-
* sensor.reportDetections(false);
|
|
4762
|
-
* ```
|
|
4763
|
-
*/
|
|
4764
|
-
reportDetections(detected: boolean, detections?: ClassifierDetection[]): void;
|
|
4765
|
-
/**
|
|
4766
|
-
* Explicitly clear classifier state (detected = false, detections = [], labels = []).
|
|
4767
|
-
*
|
|
4768
|
-
* @example
|
|
4769
|
-
* ```ts
|
|
4770
|
-
* sensor.clearDetections();
|
|
4771
|
-
* ```
|
|
4772
|
-
*/
|
|
4773
|
-
clearDetections(): void;
|
|
4774
|
-
/**
|
|
4775
|
-
* Read-only sensor: external writes are ignored. State is reported via `reportDetections`.
|
|
4776
|
-
*
|
|
4777
|
-
* Called by the cross-process plugin host when a generic property write is received.
|
|
4778
|
-
* Classifier sensors have no externally writable properties, so the parameters are
|
|
4779
|
-
* unused (underscore-prefixed) and the call is a no-op.
|
|
4780
|
-
*
|
|
4781
|
-
* @param _property - Unused — classifier sensors expose no writable properties.
|
|
4782
|
-
*
|
|
4783
|
-
* @param _value - Unused — classifier sensors expose no writable properties.
|
|
4784
|
-
*
|
|
4785
|
-
* @internal
|
|
4786
|
-
*/
|
|
4787
|
-
updateValue(_property: string, _value: unknown): void;
|
|
4788
|
-
}
|
|
4789
|
-
/** Return type for {@link ClassifierDetectorSensor.detectClassifications}. */
|
|
4790
|
-
interface ClassifierResult {
|
|
4791
|
-
/** Whether any classification result is emitted for this frame. */
|
|
4792
|
-
detected: boolean;
|
|
4793
|
-
/** Detections emitted for this frame. */
|
|
4794
|
-
detections: ClassifierDetection[];
|
|
4795
|
-
}
|
|
4796
|
-
/**
|
|
4797
|
-
* Classifier detector that receives video frames from the backend pipeline.
|
|
4798
|
-
* Extend this class and implement {@link detectClassifications} to run image
|
|
4799
|
-
* classification models against trigger regions.
|
|
4800
|
-
*/
|
|
4801
|
-
declare abstract class ClassifierDetectorSensor<TStorage extends object = Record<string, any>> extends ClassifierSensor<TStorage> {
|
|
4802
|
-
_requiresFrames: boolean;
|
|
4803
|
-
/** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
|
|
4804
|
-
abstract get modelSpec(): ModelSpec;
|
|
4805
|
-
/**
|
|
4806
|
-
* Classify frames in batch. Each frame is a pre-cropped, pre-scaled
|
|
4807
|
-
* trigger region produced by the upstream object detector. Must return
|
|
4808
|
-
* exactly one ClassifierResult per input frame, in the same order.
|
|
4809
|
-
*/
|
|
4810
|
-
abstract detectClassifications(frames: VideoFrameData[]): Promise<ClassifierResult[]>;
|
|
4811
|
-
}
|
|
4812
|
-
|
|
4813
5776
|
/** A CLIP embedding result for a detected region. */
|
|
4814
5777
|
interface ClipEmbedding {
|
|
4815
5778
|
/** Detection label this embedding was computed for (e.g. `'person'`, `'vehicle'`). */
|
|
@@ -4860,6 +5823,16 @@ declare abstract class ClipDetectorSensor<TStorage extends object = Record<strin
|
|
|
4860
5823
|
*/
|
|
4861
5824
|
updateValue(_property: string, _value: unknown): void;
|
|
4862
5825
|
}
|
|
5826
|
+
/** Registry metadata for {@link ClipDetectorSensor}. */
|
|
5827
|
+
declare const clipMeta: {
|
|
5828
|
+
readonly type: SensorType.Clip;
|
|
5829
|
+
readonly category: SensorCategory.Sensor;
|
|
5830
|
+
readonly assignmentKey: "clip";
|
|
5831
|
+
readonly multiProvider: false;
|
|
5832
|
+
readonly isDetectionType: true;
|
|
5833
|
+
readonly properties: readonly [];
|
|
5834
|
+
readonly semantics: null;
|
|
5835
|
+
};
|
|
4863
5836
|
|
|
4864
5837
|
/**
|
|
4865
5838
|
* Lifecycle events emitted on the PluginAPI EventEmitter. Plugins subscribe
|
|
@@ -5842,5 +6815,5 @@ interface OAuthClientCredentialsCapable extends OAuthCapable {
|
|
|
5842
6815
|
configureClientCredentials(clientId: string, clientSecret: string): Promise<OAuthState>;
|
|
5843
6816
|
}
|
|
5844
6817
|
|
|
5845
|
-
export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, canCreateCameras, canProvideSensorsToAnyCameras, distinctUntilChanged, filter, firstValueFrom, getContractValidationErrors, hasCapability, hasInterface, isHub, map, mergeMap, pairwise, share, validateContractConsistency };
|
|
5846
|
-
export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PTZRelativeMove, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
|
|
6818
|
+
export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, OBJECT_DETECTION_LABELS, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SENSOR_META, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorDomain, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, audioMeta, batteryMeta, canCreateCameras, canProvideSensorsToAnyCameras, classifierMeta, clipMeta, contactMeta, defineSensor, distinctUntilChanged, doorbellMeta, faceMeta, filter, firstValueFrom, garageMeta, getContractValidationErrors, hasCapability, hasInterface, humidityMeta, isHub, leakMeta, licensePlateMeta, lightMeta, lockMeta, map, mergeMap, motionMeta, objectMeta, occupancyMeta, pairwise, ptzMeta, securitySystemMeta, sensorMeta, share, sirenMeta, smokeMeta, switchMeta, temperatureMeta, validateContractConsistency };
|
|
6819
|
+
export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraAspectRatioPreset, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionLabel, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PTZRelativeMove, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorAssignmentKey, SensorCapability, SensorCascadeTrigger, SensorLike, SensorMeta, SensorPropertyType, SensorSemantics, SensorTriggerRef, SensorTriggerSettings, SensorVirtualDefaults, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
|