@camstack/addon-provider-gree 0.2.67 → 0.2.69

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
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let dgram = require("dgram");
3
3
  let crypto$1 = require("crypto");
4
4
  let events = require("events");
5
- //#region ../types/dist/event-category-BZL-fdNj.mjs
5
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -374,6 +374,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
374
374
  */
375
375
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
376
376
  /**
377
+ * Cap event fired by every device that registers the `network-link`
378
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
379
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
380
+ * reading that moved.
381
+ */
382
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
383
+ /**
377
384
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
378
385
  * "wake in progress" window — between the Baichuan wake-up issue and
379
386
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19392,6 +19399,33 @@ var RecentTracksQueryInput = object({
19392
19399
  */
19393
19400
  classes: array(string()).optional()
19394
19401
  });
19402
+ /**
19403
+ * A Summary (D359): the per-camera session envelope that references tracks.
19404
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19405
+ * served by the event-media plane by key), null until the first frame with a
19406
+ * member visible has been materialised.
19407
+ */
19408
+ var SummarySchema = object({
19409
+ id: string(),
19410
+ deviceId: number(),
19411
+ openedAt: number(),
19412
+ lastActiveAt: number(),
19413
+ sealedAt: number().nullable(),
19414
+ memberCount: number().int().nonnegative(),
19415
+ groupShotKey: string().nullable()
19416
+ });
19417
+ var SummariesQueryInput = object({
19418
+ deviceIds: array(number()).min(1),
19419
+ since: number().optional(),
19420
+ until: number().optional(),
19421
+ limit: number().int().min(1).max(200).default(50)
19422
+ });
19423
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19424
+ var SummaryDetailSchema = object({
19425
+ summary: SummarySchema,
19426
+ /** Member track ids, in absorption order. */
19427
+ trackIds: array(string()).readonly()
19428
+ });
19395
19429
  var RecentTracksPageSchema = object({
19396
19430
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19397
19431
  tracks: array(TrackSchema).readonly(),
@@ -19792,7 +19826,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19792
19826
  * timeline would read as a camera that saw nothing.
19793
19827
  */
19794
19828
  classes: array(string()).optional()
19795
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19829
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19796
19830
  kind: "mutation",
19797
19831
  auth: "admin"
19798
19832
  }), 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({
@@ -23725,6 +23759,88 @@ onStatusChanged: { data: object({
23725
23759
  volatileStateFields: ["lastUpdated"]
23726
23760
  };
23727
23761
  /**
23762
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23763
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23764
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23765
+ * one Home Assistant projection.
23766
+ */
23767
+ var NetworkLinkStatusSchema = object({
23768
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23769
+ type: _enum([
23770
+ "wifi",
23771
+ "ethernet",
23772
+ "cellular",
23773
+ "unknown"
23774
+ ]),
23775
+ /**
23776
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23777
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23778
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23779
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23780
+ * SKIP a null rather than coerce it.
23781
+ */
23782
+ signalPercent: number().min(0).max(100).nullable(),
23783
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23784
+ rssiDbm: number().optional(),
23785
+ /** Network name of a wireless link, when the firmware reports it. */
23786
+ ssid: string().optional(),
23787
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23788
+ lastUpdated: number()
23789
+ });
23790
+ var networkLinkCapability = {
23791
+ name: "network-link",
23792
+ scope: "device",
23793
+ deviceNative: true,
23794
+ mode: "singleton",
23795
+ deviceTypes: [
23796
+ DeviceType.Camera,
23797
+ DeviceType.Sensor,
23798
+ DeviceType.Button,
23799
+ DeviceType.Switch,
23800
+ DeviceType.Light,
23801
+ DeviceType.Lock,
23802
+ DeviceType.Siren
23803
+ ],
23804
+ methods: {},
23805
+ events: {
23806
+ /**
23807
+ * Emitted whenever the cached status changes (a link switch, a signal
23808
+ * reading that moved). Mirrored on the parent chain by the
23809
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23810
+ */
23811
+ onStatusChanged: { data: object({
23812
+ deviceId: number(),
23813
+ status: NetworkLinkStatusSchema
23814
+ }) } },
23815
+ status: {
23816
+ schema: NetworkLinkStatusSchema,
23817
+ kind: "push",
23818
+ empty: {
23819
+ type: "unknown",
23820
+ signalPercent: null,
23821
+ lastUpdated: 0
23822
+ }
23823
+ },
23824
+ /**
23825
+ * Runtime-state slice — every provider stores the same shape under
23826
+ * `device.runtimeState['network-link']`, read once by the badge and the
23827
+ * Home Assistant projector regardless of the driver.
23828
+ */
23829
+ runtimeState: NetworkLinkStatusSchema,
23830
+ /**
23831
+ * Runtime-state durability: **restored** — a link reading is slow to
23832
+ * change and a sleeping battery camera may not report for hours; the
23833
+ * restored slice is what the badge shows until the next read.
23834
+ *
23835
+ * See `RuntimeStateDurability`. Enforced by
23836
+ * `scripts/check-runtime-state-durability.ts`.
23837
+ */
23838
+ durability: "restored",
23839
+ /** Clock fields: written, but excluded from the compare that decides
23840
+ * whether persisting is worth a SQLite commit. */
23841
+ volatileStateFields: ["lastUpdated"]
23842
+ };
23843
+ /**
23728
23844
  * Generic boolean sensor — last-resort fallback when no domain-
23729
23845
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23730
23846
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32109,6 +32225,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32109
32225
  motionTrigger: motionTriggerCapability,
32110
32226
  motionZones: motionZonesCapability,
32111
32227
  nativeObjectDetection: nativeObjectDetectionCapability,
32228
+ networkLink: networkLinkCapability,
32112
32229
  notifier: notifierCapability,
32113
32230
  numericSensor: numericSensorCapability,
32114
32231
  petFeeder: petFeederCapability,
@@ -36526,6 +36643,12 @@ Object.freeze({
36526
36643
  addonId: null,
36527
36644
  access: "view"
36528
36645
  },
36646
+ "pipelineAnalytics.getSummary": {
36647
+ capName: "pipeline-analytics",
36648
+ capScope: "device",
36649
+ addonId: null,
36650
+ access: "view"
36651
+ },
36529
36652
  "pipelineAnalytics.getTrack": {
36530
36653
  capName: "pipeline-analytics",
36531
36654
  capScope: "device",
@@ -36604,6 +36727,12 @@ Object.freeze({
36604
36727
  addonId: null,
36605
36728
  access: "view"
36606
36729
  },
36730
+ "pipelineAnalytics.listSummaries": {
36731
+ capName: "pipeline-analytics",
36732
+ capScope: "device",
36733
+ addonId: null,
36734
+ access: "view"
36735
+ },
36607
36736
  "pipelineAnalytics.listTrackMedia": {
36608
36737
  capName: "pipeline-analytics",
36609
36738
  capScope: "device",
@@ -40299,6 +40428,11 @@ Object.freeze({
40299
40428
  form: "array",
40300
40429
  optional: true
40301
40430
  }],
40431
+ "pipelineAnalytics.listSummaries": [{
40432
+ name: "deviceIds",
40433
+ form: "array",
40434
+ optional: false
40435
+ }],
40302
40436
  "pipelineAnalytics.listTrackMedia": [{
40303
40437
  name: "deviceId",
40304
40438
  form: "single",
package/dist/addon.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createSocket } from "dgram";
2
2
  import { createCipheriv, createDecipheriv } from "crypto";
3
3
  import { EventEmitter } from "events";
4
- //#region ../types/dist/event-category-BZL-fdNj.mjs
4
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
5
5
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
6
6
  EventCategory["SystemBoot"] = "system.boot";
7
7
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -373,6 +373,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
373
373
  */
374
374
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
375
375
  /**
376
+ * Cap event fired by every device that registers the `network-link`
377
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
378
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
379
+ * reading that moved.
380
+ */
381
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
382
+ /**
376
383
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
377
384
  * "wake in progress" window — between the Baichuan wake-up issue and
378
385
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19391,6 +19398,33 @@ var RecentTracksQueryInput = object({
19391
19398
  */
19392
19399
  classes: array(string()).optional()
19393
19400
  });
19401
+ /**
19402
+ * A Summary (D359): the per-camera session envelope that references tracks.
19403
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19404
+ * served by the event-media plane by key), null until the first frame with a
19405
+ * member visible has been materialised.
19406
+ */
19407
+ var SummarySchema = object({
19408
+ id: string(),
19409
+ deviceId: number(),
19410
+ openedAt: number(),
19411
+ lastActiveAt: number(),
19412
+ sealedAt: number().nullable(),
19413
+ memberCount: number().int().nonnegative(),
19414
+ groupShotKey: string().nullable()
19415
+ });
19416
+ var SummariesQueryInput = object({
19417
+ deviceIds: array(number()).min(1),
19418
+ since: number().optional(),
19419
+ until: number().optional(),
19420
+ limit: number().int().min(1).max(200).default(50)
19421
+ });
19422
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19423
+ var SummaryDetailSchema = object({
19424
+ summary: SummarySchema,
19425
+ /** Member track ids, in absorption order. */
19426
+ trackIds: array(string()).readonly()
19427
+ });
19394
19428
  var RecentTracksPageSchema = object({
19395
19429
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19396
19430
  tracks: array(TrackSchema).readonly(),
@@ -19791,7 +19825,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19791
19825
  * timeline would read as a camera that saw nothing.
19792
19826
  */
19793
19827
  classes: array(string()).optional()
19794
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19828
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19795
19829
  kind: "mutation",
19796
19830
  auth: "admin"
19797
19831
  }), 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({
@@ -23724,6 +23758,88 @@ onStatusChanged: { data: object({
23724
23758
  volatileStateFields: ["lastUpdated"]
23725
23759
  };
23726
23760
  /**
23761
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23762
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23763
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23764
+ * one Home Assistant projection.
23765
+ */
23766
+ var NetworkLinkStatusSchema = object({
23767
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23768
+ type: _enum([
23769
+ "wifi",
23770
+ "ethernet",
23771
+ "cellular",
23772
+ "unknown"
23773
+ ]),
23774
+ /**
23775
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23776
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23777
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23778
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23779
+ * SKIP a null rather than coerce it.
23780
+ */
23781
+ signalPercent: number().min(0).max(100).nullable(),
23782
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23783
+ rssiDbm: number().optional(),
23784
+ /** Network name of a wireless link, when the firmware reports it. */
23785
+ ssid: string().optional(),
23786
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23787
+ lastUpdated: number()
23788
+ });
23789
+ var networkLinkCapability = {
23790
+ name: "network-link",
23791
+ scope: "device",
23792
+ deviceNative: true,
23793
+ mode: "singleton",
23794
+ deviceTypes: [
23795
+ DeviceType.Camera,
23796
+ DeviceType.Sensor,
23797
+ DeviceType.Button,
23798
+ DeviceType.Switch,
23799
+ DeviceType.Light,
23800
+ DeviceType.Lock,
23801
+ DeviceType.Siren
23802
+ ],
23803
+ methods: {},
23804
+ events: {
23805
+ /**
23806
+ * Emitted whenever the cached status changes (a link switch, a signal
23807
+ * reading that moved). Mirrored on the parent chain by the
23808
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23809
+ */
23810
+ onStatusChanged: { data: object({
23811
+ deviceId: number(),
23812
+ status: NetworkLinkStatusSchema
23813
+ }) } },
23814
+ status: {
23815
+ schema: NetworkLinkStatusSchema,
23816
+ kind: "push",
23817
+ empty: {
23818
+ type: "unknown",
23819
+ signalPercent: null,
23820
+ lastUpdated: 0
23821
+ }
23822
+ },
23823
+ /**
23824
+ * Runtime-state slice — every provider stores the same shape under
23825
+ * `device.runtimeState['network-link']`, read once by the badge and the
23826
+ * Home Assistant projector regardless of the driver.
23827
+ */
23828
+ runtimeState: NetworkLinkStatusSchema,
23829
+ /**
23830
+ * Runtime-state durability: **restored** — a link reading is slow to
23831
+ * change and a sleeping battery camera may not report for hours; the
23832
+ * restored slice is what the badge shows until the next read.
23833
+ *
23834
+ * See `RuntimeStateDurability`. Enforced by
23835
+ * `scripts/check-runtime-state-durability.ts`.
23836
+ */
23837
+ durability: "restored",
23838
+ /** Clock fields: written, but excluded from the compare that decides
23839
+ * whether persisting is worth a SQLite commit. */
23840
+ volatileStateFields: ["lastUpdated"]
23841
+ };
23842
+ /**
23727
23843
  * Generic boolean sensor — last-resort fallback when no domain-
23728
23844
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23729
23845
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32108,6 +32224,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32108
32224
  motionTrigger: motionTriggerCapability,
32109
32225
  motionZones: motionZonesCapability,
32110
32226
  nativeObjectDetection: nativeObjectDetectionCapability,
32227
+ networkLink: networkLinkCapability,
32111
32228
  notifier: notifierCapability,
32112
32229
  numericSensor: numericSensorCapability,
32113
32230
  petFeeder: petFeederCapability,
@@ -36525,6 +36642,12 @@ Object.freeze({
36525
36642
  addonId: null,
36526
36643
  access: "view"
36527
36644
  },
36645
+ "pipelineAnalytics.getSummary": {
36646
+ capName: "pipeline-analytics",
36647
+ capScope: "device",
36648
+ addonId: null,
36649
+ access: "view"
36650
+ },
36528
36651
  "pipelineAnalytics.getTrack": {
36529
36652
  capName: "pipeline-analytics",
36530
36653
  capScope: "device",
@@ -36603,6 +36726,12 @@ Object.freeze({
36603
36726
  addonId: null,
36604
36727
  access: "view"
36605
36728
  },
36729
+ "pipelineAnalytics.listSummaries": {
36730
+ capName: "pipeline-analytics",
36731
+ capScope: "device",
36732
+ addonId: null,
36733
+ access: "view"
36734
+ },
36606
36735
  "pipelineAnalytics.listTrackMedia": {
36607
36736
  capName: "pipeline-analytics",
36608
36737
  capScope: "device",
@@ -40298,6 +40427,11 @@ Object.freeze({
40298
40427
  form: "array",
40299
40428
  optional: true
40300
40429
  }],
40430
+ "pipelineAnalytics.listSummaries": [{
40431
+ name: "deviceIds",
40432
+ form: "array",
40433
+ optional: false
40434
+ }],
40301
40435
  "pipelineAnalytics.listTrackMedia": [{
40302
40436
  name: "deviceId",
40303
40437
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-gree",
3
- "version": "0.2.67",
3
+ "version": "0.2.69",
4
4
  "description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
5
5
  "keywords": [
6
6
  "camstack",