@camstack/addon-provider-petkit 0.2.69 → 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
@@ -24868,6 +24875,88 @@ onStatusChanged: { data: object({
24868
24875
  volatileStateFields: ["lastUpdated"]
24869
24876
  };
24870
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
+ /**
24871
24960
  * Generic boolean sensor — last-resort fallback when no domain-
24872
24961
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24873
24962
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -33260,6 +33349,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33260
33349
  motionTrigger: motionTriggerCapability,
33261
33350
  motionZones: motionZonesCapability,
33262
33351
  nativeObjectDetection: nativeObjectDetectionCapability,
33352
+ networkLink: networkLinkCapability,
33263
33353
  notifier: notifierCapability,
33264
33354
  numericSensor: numericSensorCapability,
33265
33355
  petFeeder: petFeederCapability,
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
@@ -24867,6 +24874,88 @@ onStatusChanged: { data: object({
24867
24874
  volatileStateFields: ["lastUpdated"]
24868
24875
  };
24869
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
+ /**
24870
24959
  * Generic boolean sensor — last-resort fallback when no domain-
24871
24960
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24872
24961
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -33259,6 +33348,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
33259
33348
  motionTrigger: motionTriggerCapability,
33260
33349
  motionZones: motionZonesCapability,
33261
33350
  nativeObjectDetection: nativeObjectDetectionCapability,
33351
+ networkLink: networkLinkCapability,
33262
33352
  notifier: notifierCapability,
33263
33353
  numericSensor: numericSensorCapability,
33264
33354
  petFeeder: petFeederCapability,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.69",
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",