@camstack/addon-provider-dreo 0.2.68 → 0.2.70

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/addon.js CHANGED
@@ -35,7 +35,7 @@ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["modu
35
35
  //#endregion
36
36
  let crypto$1 = require("crypto");
37
37
  let events = require("events");
38
- //#region ../types/dist/event-category-BZL-fdNj.mjs
38
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
39
39
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
40
40
  EventCategory["SystemBoot"] = "system.boot";
41
41
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -407,6 +407,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
407
407
  */
408
408
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
409
409
  /**
410
+ * Cap event fired by every device that registers the `network-link`
411
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
412
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
413
+ * reading that moved.
414
+ */
415
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
416
+ /**
410
417
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
411
418
  * "wake in progress" window — between the Baichuan wake-up issue and
412
419
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19442,6 +19449,33 @@ var RecentTracksQueryInput = object({
19442
19449
  */
19443
19450
  classes: array(string()).optional()
19444
19451
  });
19452
+ /**
19453
+ * A Summary (D359): the per-camera session envelope that references tracks.
19454
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19455
+ * served by the event-media plane by key), null until the first frame with a
19456
+ * member visible has been materialised.
19457
+ */
19458
+ var SummarySchema = object({
19459
+ id: string(),
19460
+ deviceId: number(),
19461
+ openedAt: number(),
19462
+ lastActiveAt: number(),
19463
+ sealedAt: number().nullable(),
19464
+ memberCount: number().int().nonnegative(),
19465
+ groupShotKey: string().nullable()
19466
+ });
19467
+ var SummariesQueryInput = object({
19468
+ deviceIds: array(number()).min(1),
19469
+ since: number().optional(),
19470
+ until: number().optional(),
19471
+ limit: number().int().min(1).max(200).default(50)
19472
+ });
19473
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19474
+ var SummaryDetailSchema = object({
19475
+ summary: SummarySchema,
19476
+ /** Member track ids, in absorption order. */
19477
+ trackIds: array(string()).readonly()
19478
+ });
19445
19479
  var RecentTracksPageSchema = object({
19446
19480
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19447
19481
  tracks: array(TrackSchema).readonly(),
@@ -19842,7 +19876,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19842
19876
  * timeline would read as a camera that saw nothing.
19843
19877
  */
19844
19878
  classes: array(string()).optional()
19845
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19879
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19846
19880
  kind: "mutation",
19847
19881
  auth: "admin"
19848
19882
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23775,6 +23809,88 @@ onStatusChanged: { data: object({
23775
23809
  volatileStateFields: ["lastUpdated"]
23776
23810
  };
23777
23811
  /**
23812
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23813
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23814
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23815
+ * one Home Assistant projection.
23816
+ */
23817
+ var NetworkLinkStatusSchema = object({
23818
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23819
+ type: _enum([
23820
+ "wifi",
23821
+ "ethernet",
23822
+ "cellular",
23823
+ "unknown"
23824
+ ]),
23825
+ /**
23826
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23827
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23828
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23829
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23830
+ * SKIP a null rather than coerce it.
23831
+ */
23832
+ signalPercent: number().min(0).max(100).nullable(),
23833
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23834
+ rssiDbm: number().optional(),
23835
+ /** Network name of a wireless link, when the firmware reports it. */
23836
+ ssid: string().optional(),
23837
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23838
+ lastUpdated: number()
23839
+ });
23840
+ var networkLinkCapability = {
23841
+ name: "network-link",
23842
+ scope: "device",
23843
+ deviceNative: true,
23844
+ mode: "singleton",
23845
+ deviceTypes: [
23846
+ DeviceType.Camera,
23847
+ DeviceType.Sensor,
23848
+ DeviceType.Button,
23849
+ DeviceType.Switch,
23850
+ DeviceType.Light,
23851
+ DeviceType.Lock,
23852
+ DeviceType.Siren
23853
+ ],
23854
+ methods: {},
23855
+ events: {
23856
+ /**
23857
+ * Emitted whenever the cached status changes (a link switch, a signal
23858
+ * reading that moved). Mirrored on the parent chain by the
23859
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23860
+ */
23861
+ onStatusChanged: { data: object({
23862
+ deviceId: number(),
23863
+ status: NetworkLinkStatusSchema
23864
+ }) } },
23865
+ status: {
23866
+ schema: NetworkLinkStatusSchema,
23867
+ kind: "push",
23868
+ empty: {
23869
+ type: "unknown",
23870
+ signalPercent: null,
23871
+ lastUpdated: 0
23872
+ }
23873
+ },
23874
+ /**
23875
+ * Runtime-state slice — every provider stores the same shape under
23876
+ * `device.runtimeState['network-link']`, read once by the badge and the
23877
+ * Home Assistant projector regardless of the driver.
23878
+ */
23879
+ runtimeState: NetworkLinkStatusSchema,
23880
+ /**
23881
+ * Runtime-state durability: **restored** — a link reading is slow to
23882
+ * change and a sleeping battery camera may not report for hours; the
23883
+ * restored slice is what the badge shows until the next read.
23884
+ *
23885
+ * See `RuntimeStateDurability`. Enforced by
23886
+ * `scripts/check-runtime-state-durability.ts`.
23887
+ */
23888
+ durability: "restored",
23889
+ /** Clock fields: written, but excluded from the compare that decides
23890
+ * whether persisting is worth a SQLite commit. */
23891
+ volatileStateFields: ["lastUpdated"]
23892
+ };
23893
+ /**
23778
23894
  * Generic boolean sensor — last-resort fallback when no domain-
23779
23895
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23780
23896
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32167,6 +32283,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32167
32283
  motionTrigger: motionTriggerCapability,
32168
32284
  motionZones: motionZonesCapability,
32169
32285
  nativeObjectDetection: nativeObjectDetectionCapability,
32286
+ networkLink: networkLinkCapability,
32170
32287
  notifier: notifierCapability,
32171
32288
  numericSensor: numericSensorCapability,
32172
32289
  petFeeder: petFeederCapability,
@@ -36584,6 +36701,12 @@ Object.freeze({
36584
36701
  addonId: null,
36585
36702
  access: "view"
36586
36703
  },
36704
+ "pipelineAnalytics.getSummary": {
36705
+ capName: "pipeline-analytics",
36706
+ capScope: "device",
36707
+ addonId: null,
36708
+ access: "view"
36709
+ },
36587
36710
  "pipelineAnalytics.getTrack": {
36588
36711
  capName: "pipeline-analytics",
36589
36712
  capScope: "device",
@@ -36662,6 +36785,12 @@ Object.freeze({
36662
36785
  addonId: null,
36663
36786
  access: "view"
36664
36787
  },
36788
+ "pipelineAnalytics.listSummaries": {
36789
+ capName: "pipeline-analytics",
36790
+ capScope: "device",
36791
+ addonId: null,
36792
+ access: "view"
36793
+ },
36665
36794
  "pipelineAnalytics.listTrackMedia": {
36666
36795
  capName: "pipeline-analytics",
36667
36796
  capScope: "device",
@@ -40357,6 +40486,11 @@ Object.freeze({
40357
40486
  form: "array",
40358
40487
  optional: true
40359
40488
  }],
40489
+ "pipelineAnalytics.listSummaries": [{
40490
+ name: "deviceIds",
40491
+ form: "array",
40492
+ optional: false
40493
+ }],
40360
40494
  "pipelineAnalytics.listTrackMedia": [{
40361
40495
  name: "deviceId",
40362
40496
  form: "single",
package/dist/addon.mjs CHANGED
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-BZL-fdNj.mjs
39
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -408,6 +408,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
408
408
  */
409
409
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
410
410
  /**
411
+ * Cap event fired by every device that registers the `network-link`
412
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
413
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
414
+ * reading that moved.
415
+ */
416
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
417
+ /**
411
418
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
412
419
  * "wake in progress" window — between the Baichuan wake-up issue and
413
420
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19443,6 +19450,33 @@ var RecentTracksQueryInput = object({
19443
19450
  */
19444
19451
  classes: array(string()).optional()
19445
19452
  });
19453
+ /**
19454
+ * A Summary (D359): the per-camera session envelope that references tracks.
19455
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19456
+ * served by the event-media plane by key), null until the first frame with a
19457
+ * member visible has been materialised.
19458
+ */
19459
+ var SummarySchema = object({
19460
+ id: string(),
19461
+ deviceId: number(),
19462
+ openedAt: number(),
19463
+ lastActiveAt: number(),
19464
+ sealedAt: number().nullable(),
19465
+ memberCount: number().int().nonnegative(),
19466
+ groupShotKey: string().nullable()
19467
+ });
19468
+ var SummariesQueryInput = object({
19469
+ deviceIds: array(number()).min(1),
19470
+ since: number().optional(),
19471
+ until: number().optional(),
19472
+ limit: number().int().min(1).max(200).default(50)
19473
+ });
19474
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19475
+ var SummaryDetailSchema = object({
19476
+ summary: SummarySchema,
19477
+ /** Member track ids, in absorption order. */
19478
+ trackIds: array(string()).readonly()
19479
+ });
19446
19480
  var RecentTracksPageSchema = object({
19447
19481
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19448
19482
  tracks: array(TrackSchema).readonly(),
@@ -19843,7 +19877,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19843
19877
  * timeline would read as a camera that saw nothing.
19844
19878
  */
19845
19879
  classes: array(string()).optional()
19846
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19880
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19847
19881
  kind: "mutation",
19848
19882
  auth: "admin"
19849
19883
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23776,6 +23810,88 @@ onStatusChanged: { data: object({
23776
23810
  volatileStateFields: ["lastUpdated"]
23777
23811
  };
23778
23812
  /**
23813
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23814
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23815
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23816
+ * one Home Assistant projection.
23817
+ */
23818
+ var NetworkLinkStatusSchema = object({
23819
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23820
+ type: _enum([
23821
+ "wifi",
23822
+ "ethernet",
23823
+ "cellular",
23824
+ "unknown"
23825
+ ]),
23826
+ /**
23827
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23828
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23829
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23830
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23831
+ * SKIP a null rather than coerce it.
23832
+ */
23833
+ signalPercent: number().min(0).max(100).nullable(),
23834
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23835
+ rssiDbm: number().optional(),
23836
+ /** Network name of a wireless link, when the firmware reports it. */
23837
+ ssid: string().optional(),
23838
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23839
+ lastUpdated: number()
23840
+ });
23841
+ var networkLinkCapability = {
23842
+ name: "network-link",
23843
+ scope: "device",
23844
+ deviceNative: true,
23845
+ mode: "singleton",
23846
+ deviceTypes: [
23847
+ DeviceType.Camera,
23848
+ DeviceType.Sensor,
23849
+ DeviceType.Button,
23850
+ DeviceType.Switch,
23851
+ DeviceType.Light,
23852
+ DeviceType.Lock,
23853
+ DeviceType.Siren
23854
+ ],
23855
+ methods: {},
23856
+ events: {
23857
+ /**
23858
+ * Emitted whenever the cached status changes (a link switch, a signal
23859
+ * reading that moved). Mirrored on the parent chain by the
23860
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23861
+ */
23862
+ onStatusChanged: { data: object({
23863
+ deviceId: number(),
23864
+ status: NetworkLinkStatusSchema
23865
+ }) } },
23866
+ status: {
23867
+ schema: NetworkLinkStatusSchema,
23868
+ kind: "push",
23869
+ empty: {
23870
+ type: "unknown",
23871
+ signalPercent: null,
23872
+ lastUpdated: 0
23873
+ }
23874
+ },
23875
+ /**
23876
+ * Runtime-state slice — every provider stores the same shape under
23877
+ * `device.runtimeState['network-link']`, read once by the badge and the
23878
+ * Home Assistant projector regardless of the driver.
23879
+ */
23880
+ runtimeState: NetworkLinkStatusSchema,
23881
+ /**
23882
+ * Runtime-state durability: **restored** — a link reading is slow to
23883
+ * change and a sleeping battery camera may not report for hours; the
23884
+ * restored slice is what the badge shows until the next read.
23885
+ *
23886
+ * See `RuntimeStateDurability`. Enforced by
23887
+ * `scripts/check-runtime-state-durability.ts`.
23888
+ */
23889
+ durability: "restored",
23890
+ /** Clock fields: written, but excluded from the compare that decides
23891
+ * whether persisting is worth a SQLite commit. */
23892
+ volatileStateFields: ["lastUpdated"]
23893
+ };
23894
+ /**
23779
23895
  * Generic boolean sensor — last-resort fallback when no domain-
23780
23896
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23781
23897
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32168,6 +32284,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32168
32284
  motionTrigger: motionTriggerCapability,
32169
32285
  motionZones: motionZonesCapability,
32170
32286
  nativeObjectDetection: nativeObjectDetectionCapability,
32287
+ networkLink: networkLinkCapability,
32171
32288
  notifier: notifierCapability,
32172
32289
  numericSensor: numericSensorCapability,
32173
32290
  petFeeder: petFeederCapability,
@@ -36585,6 +36702,12 @@ Object.freeze({
36585
36702
  addonId: null,
36586
36703
  access: "view"
36587
36704
  },
36705
+ "pipelineAnalytics.getSummary": {
36706
+ capName: "pipeline-analytics",
36707
+ capScope: "device",
36708
+ addonId: null,
36709
+ access: "view"
36710
+ },
36588
36711
  "pipelineAnalytics.getTrack": {
36589
36712
  capName: "pipeline-analytics",
36590
36713
  capScope: "device",
@@ -36663,6 +36786,12 @@ Object.freeze({
36663
36786
  addonId: null,
36664
36787
  access: "view"
36665
36788
  },
36789
+ "pipelineAnalytics.listSummaries": {
36790
+ capName: "pipeline-analytics",
36791
+ capScope: "device",
36792
+ addonId: null,
36793
+ access: "view"
36794
+ },
36666
36795
  "pipelineAnalytics.listTrackMedia": {
36667
36796
  capName: "pipeline-analytics",
36668
36797
  capScope: "device",
@@ -40358,6 +40487,11 @@ Object.freeze({
40358
40487
  form: "array",
40359
40488
  optional: true
40360
40489
  }],
40490
+ "pipelineAnalytics.listSummaries": [{
40491
+ name: "deviceIds",
40492
+ form: "array",
40493
+ optional: false
40494
+ }],
40361
40495
  "pipelineAnalytics.listTrackMedia": [{
40362
40496
  name: "deviceId",
40363
40497
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",