@camstack/addon-provider-petkit 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
@@ -1101,7 +1101,7 @@ var Nodepetkit = class {
1101
1101
  }
1102
1102
  };
1103
1103
  //#endregion
1104
- //#region ../types/dist/event-category-BZL-fdNj.mjs
1104
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
1105
1105
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1106
1106
  EventCategory["SystemBoot"] = "system.boot";
1107
1107
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1473,6 +1473,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1473
1473
  */
1474
1474
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
1475
1475
  /**
1476
+ * Cap event fired by every device that registers the `network-link`
1477
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
1478
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
1479
+ * reading that moved.
1480
+ */
1481
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
1482
+ /**
1476
1483
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
1477
1484
  * "wake in progress" window — between the Baichuan wake-up issue and
1478
1485
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -20508,6 +20515,33 @@ var RecentTracksQueryInput = object({
20508
20515
  */
20509
20516
  classes: array(string()).optional()
20510
20517
  });
20518
+ /**
20519
+ * A Summary (D359): the per-camera session envelope that references tracks.
20520
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
20521
+ * served by the event-media plane by key), null until the first frame with a
20522
+ * member visible has been materialised.
20523
+ */
20524
+ var SummarySchema = object({
20525
+ id: string(),
20526
+ deviceId: number(),
20527
+ openedAt: number(),
20528
+ lastActiveAt: number(),
20529
+ sealedAt: number().nullable(),
20530
+ memberCount: number().int().nonnegative(),
20531
+ groupShotKey: string().nullable()
20532
+ });
20533
+ var SummariesQueryInput = object({
20534
+ deviceIds: array(number()).min(1),
20535
+ since: number().optional(),
20536
+ until: number().optional(),
20537
+ limit: number().int().min(1).max(200).default(50)
20538
+ });
20539
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
20540
+ var SummaryDetailSchema = object({
20541
+ summary: SummarySchema,
20542
+ /** Member track ids, in absorption order. */
20543
+ trackIds: array(string()).readonly()
20544
+ });
20511
20545
  var RecentTracksPageSchema = object({
20512
20546
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
20513
20547
  tracks: array(TrackSchema).readonly(),
@@ -20908,7 +20942,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20908
20942
  * timeline would read as a camera that saw nothing.
20909
20943
  */
20910
20944
  classes: array(string()).optional()
20911
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20945
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20912
20946
  kind: "mutation",
20913
20947
  auth: "admin"
20914
20948
  }), 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({
@@ -24841,6 +24875,88 @@ onStatusChanged: { data: object({
24841
24875
  volatileStateFields: ["lastUpdated"]
24842
24876
  };
24843
24877
  /**
24878
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24879
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24880
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24881
+ * one Home Assistant projection.
24882
+ */
24883
+ var NetworkLinkStatusSchema = object({
24884
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24885
+ type: _enum([
24886
+ "wifi",
24887
+ "ethernet",
24888
+ "cellular",
24889
+ "unknown"
24890
+ ]),
24891
+ /**
24892
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24893
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24894
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24895
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24896
+ * SKIP a null rather than coerce it.
24897
+ */
24898
+ signalPercent: number().min(0).max(100).nullable(),
24899
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24900
+ rssiDbm: number().optional(),
24901
+ /** Network name of a wireless link, when the firmware reports it. */
24902
+ ssid: string().optional(),
24903
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24904
+ lastUpdated: number()
24905
+ });
24906
+ var networkLinkCapability = {
24907
+ name: "network-link",
24908
+ scope: "device",
24909
+ deviceNative: true,
24910
+ mode: "singleton",
24911
+ deviceTypes: [
24912
+ DeviceType.Camera,
24913
+ DeviceType.Sensor,
24914
+ DeviceType.Button,
24915
+ DeviceType.Switch,
24916
+ DeviceType.Light,
24917
+ DeviceType.Lock,
24918
+ DeviceType.Siren
24919
+ ],
24920
+ methods: {},
24921
+ events: {
24922
+ /**
24923
+ * Emitted whenever the cached status changes (a link switch, a signal
24924
+ * reading that moved). Mirrored on the parent chain by the
24925
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24926
+ */
24927
+ onStatusChanged: { data: object({
24928
+ deviceId: number(),
24929
+ status: NetworkLinkStatusSchema
24930
+ }) } },
24931
+ status: {
24932
+ schema: NetworkLinkStatusSchema,
24933
+ kind: "push",
24934
+ empty: {
24935
+ type: "unknown",
24936
+ signalPercent: null,
24937
+ lastUpdated: 0
24938
+ }
24939
+ },
24940
+ /**
24941
+ * Runtime-state slice — every provider stores the same shape under
24942
+ * `device.runtimeState['network-link']`, read once by the badge and the
24943
+ * Home Assistant projector regardless of the driver.
24944
+ */
24945
+ runtimeState: NetworkLinkStatusSchema,
24946
+ /**
24947
+ * Runtime-state durability: **restored** — a link reading is slow to
24948
+ * change and a sleeping battery camera may not report for hours; the
24949
+ * restored slice is what the badge shows until the next read.
24950
+ *
24951
+ * See `RuntimeStateDurability`. Enforced by
24952
+ * `scripts/check-runtime-state-durability.ts`.
24953
+ */
24954
+ durability: "restored",
24955
+ /** Clock fields: written, but excluded from the compare that decides
24956
+ * whether persisting is worth a SQLite commit. */
24957
+ volatileStateFields: ["lastUpdated"]
24958
+ };
24959
+ /**
24844
24960
  * Generic boolean sensor — last-resort fallback when no domain-
24845
24961
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24846
24962
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -33233,6 +33349,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33233
33349
  motionTrigger: motionTriggerCapability,
33234
33350
  motionZones: motionZonesCapability,
33235
33351
  nativeObjectDetection: nativeObjectDetectionCapability,
33352
+ networkLink: networkLinkCapability,
33236
33353
  notifier: notifierCapability,
33237
33354
  numericSensor: numericSensorCapability,
33238
33355
  petFeeder: petFeederCapability,
@@ -37650,6 +37767,12 @@ Object.freeze({
37650
37767
  addonId: null,
37651
37768
  access: "view"
37652
37769
  },
37770
+ "pipelineAnalytics.getSummary": {
37771
+ capName: "pipeline-analytics",
37772
+ capScope: "device",
37773
+ addonId: null,
37774
+ access: "view"
37775
+ },
37653
37776
  "pipelineAnalytics.getTrack": {
37654
37777
  capName: "pipeline-analytics",
37655
37778
  capScope: "device",
@@ -37728,6 +37851,12 @@ Object.freeze({
37728
37851
  addonId: null,
37729
37852
  access: "view"
37730
37853
  },
37854
+ "pipelineAnalytics.listSummaries": {
37855
+ capName: "pipeline-analytics",
37856
+ capScope: "device",
37857
+ addonId: null,
37858
+ access: "view"
37859
+ },
37731
37860
  "pipelineAnalytics.listTrackMedia": {
37732
37861
  capName: "pipeline-analytics",
37733
37862
  capScope: "device",
@@ -41423,6 +41552,11 @@ Object.freeze({
41423
41552
  form: "array",
41424
41553
  optional: true
41425
41554
  }],
41555
+ "pipelineAnalytics.listSummaries": [{
41556
+ name: "deviceIds",
41557
+ form: "array",
41558
+ optional: false
41559
+ }],
41426
41560
  "pipelineAnalytics.listTrackMedia": [{
41427
41561
  name: "deviceId",
41428
41562
  form: "single",
package/dist/addon.mjs CHANGED
@@ -1100,7 +1100,7 @@ var Nodepetkit = class {
1100
1100
  }
1101
1101
  };
1102
1102
  //#endregion
1103
- //#region ../types/dist/event-category-BZL-fdNj.mjs
1103
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
1104
1104
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1105
1105
  EventCategory["SystemBoot"] = "system.boot";
1106
1106
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1472,6 +1472,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1472
1472
  */
1473
1473
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
1474
1474
  /**
1475
+ * Cap event fired by every device that registers the `network-link`
1476
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
1477
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
1478
+ * reading that moved.
1479
+ */
1480
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
1481
+ /**
1475
1482
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
1476
1483
  * "wake in progress" window — between the Baichuan wake-up issue and
1477
1484
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -20507,6 +20514,33 @@ var RecentTracksQueryInput = object({
20507
20514
  */
20508
20515
  classes: array(string()).optional()
20509
20516
  });
20517
+ /**
20518
+ * A Summary (D359): the per-camera session envelope that references tracks.
20519
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
20520
+ * served by the event-media plane by key), null until the first frame with a
20521
+ * member visible has been materialised.
20522
+ */
20523
+ var SummarySchema = object({
20524
+ id: string(),
20525
+ deviceId: number(),
20526
+ openedAt: number(),
20527
+ lastActiveAt: number(),
20528
+ sealedAt: number().nullable(),
20529
+ memberCount: number().int().nonnegative(),
20530
+ groupShotKey: string().nullable()
20531
+ });
20532
+ var SummariesQueryInput = object({
20533
+ deviceIds: array(number()).min(1),
20534
+ since: number().optional(),
20535
+ until: number().optional(),
20536
+ limit: number().int().min(1).max(200).default(50)
20537
+ });
20538
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
20539
+ var SummaryDetailSchema = object({
20540
+ summary: SummarySchema,
20541
+ /** Member track ids, in absorption order. */
20542
+ trackIds: array(string()).readonly()
20543
+ });
20510
20544
  var RecentTracksPageSchema = object({
20511
20545
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
20512
20546
  tracks: array(TrackSchema).readonly(),
@@ -20907,7 +20941,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20907
20941
  * timeline would read as a camera that saw nothing.
20908
20942
  */
20909
20943
  classes: array(string()).optional()
20910
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20944
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20911
20945
  kind: "mutation",
20912
20946
  auth: "admin"
20913
20947
  }), 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({
@@ -24840,6 +24874,88 @@ onStatusChanged: { data: object({
24840
24874
  volatileStateFields: ["lastUpdated"]
24841
24875
  };
24842
24876
  /**
24877
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24878
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24879
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24880
+ * one Home Assistant projection.
24881
+ */
24882
+ var NetworkLinkStatusSchema = object({
24883
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24884
+ type: _enum([
24885
+ "wifi",
24886
+ "ethernet",
24887
+ "cellular",
24888
+ "unknown"
24889
+ ]),
24890
+ /**
24891
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24892
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24893
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24894
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24895
+ * SKIP a null rather than coerce it.
24896
+ */
24897
+ signalPercent: number().min(0).max(100).nullable(),
24898
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24899
+ rssiDbm: number().optional(),
24900
+ /** Network name of a wireless link, when the firmware reports it. */
24901
+ ssid: string().optional(),
24902
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24903
+ lastUpdated: number()
24904
+ });
24905
+ var networkLinkCapability = {
24906
+ name: "network-link",
24907
+ scope: "device",
24908
+ deviceNative: true,
24909
+ mode: "singleton",
24910
+ deviceTypes: [
24911
+ DeviceType.Camera,
24912
+ DeviceType.Sensor,
24913
+ DeviceType.Button,
24914
+ DeviceType.Switch,
24915
+ DeviceType.Light,
24916
+ DeviceType.Lock,
24917
+ DeviceType.Siren
24918
+ ],
24919
+ methods: {},
24920
+ events: {
24921
+ /**
24922
+ * Emitted whenever the cached status changes (a link switch, a signal
24923
+ * reading that moved). Mirrored on the parent chain by the
24924
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24925
+ */
24926
+ onStatusChanged: { data: object({
24927
+ deviceId: number(),
24928
+ status: NetworkLinkStatusSchema
24929
+ }) } },
24930
+ status: {
24931
+ schema: NetworkLinkStatusSchema,
24932
+ kind: "push",
24933
+ empty: {
24934
+ type: "unknown",
24935
+ signalPercent: null,
24936
+ lastUpdated: 0
24937
+ }
24938
+ },
24939
+ /**
24940
+ * Runtime-state slice — every provider stores the same shape under
24941
+ * `device.runtimeState['network-link']`, read once by the badge and the
24942
+ * Home Assistant projector regardless of the driver.
24943
+ */
24944
+ runtimeState: NetworkLinkStatusSchema,
24945
+ /**
24946
+ * Runtime-state durability: **restored** — a link reading is slow to
24947
+ * change and a sleeping battery camera may not report for hours; the
24948
+ * restored slice is what the badge shows until the next read.
24949
+ *
24950
+ * See `RuntimeStateDurability`. Enforced by
24951
+ * `scripts/check-runtime-state-durability.ts`.
24952
+ */
24953
+ durability: "restored",
24954
+ /** Clock fields: written, but excluded from the compare that decides
24955
+ * whether persisting is worth a SQLite commit. */
24956
+ volatileStateFields: ["lastUpdated"]
24957
+ };
24958
+ /**
24843
24959
  * Generic boolean sensor — last-resort fallback when no domain-
24844
24960
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24845
24961
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -33232,6 +33348,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33232
33348
  motionTrigger: motionTriggerCapability,
33233
33349
  motionZones: motionZonesCapability,
33234
33350
  nativeObjectDetection: nativeObjectDetectionCapability,
33351
+ networkLink: networkLinkCapability,
33235
33352
  notifier: notifierCapability,
33236
33353
  numericSensor: numericSensorCapability,
33237
33354
  petFeeder: petFeederCapability,
@@ -37649,6 +37766,12 @@ Object.freeze({
37649
37766
  addonId: null,
37650
37767
  access: "view"
37651
37768
  },
37769
+ "pipelineAnalytics.getSummary": {
37770
+ capName: "pipeline-analytics",
37771
+ capScope: "device",
37772
+ addonId: null,
37773
+ access: "view"
37774
+ },
37652
37775
  "pipelineAnalytics.getTrack": {
37653
37776
  capName: "pipeline-analytics",
37654
37777
  capScope: "device",
@@ -37727,6 +37850,12 @@ Object.freeze({
37727
37850
  addonId: null,
37728
37851
  access: "view"
37729
37852
  },
37853
+ "pipelineAnalytics.listSummaries": {
37854
+ capName: "pipeline-analytics",
37855
+ capScope: "device",
37856
+ addonId: null,
37857
+ access: "view"
37858
+ },
37730
37859
  "pipelineAnalytics.listTrackMedia": {
37731
37860
  capName: "pipeline-analytics",
37732
37861
  capScope: "device",
@@ -41422,6 +41551,11 @@ Object.freeze({
41422
41551
  form: "array",
41423
41552
  optional: true
41424
41553
  }],
41554
+ "pipelineAnalytics.listSummaries": [{
41555
+ name: "deviceIds",
41556
+ form: "array",
41557
+ optional: false
41558
+ }],
41425
41559
  "pipelineAnalytics.listTrackMedia": [{
41426
41560
  name: "deviceId",
41427
41561
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",