@camstack/addon-import-alexa 0.2.68 → 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
@@ -38,7 +38,7 @@ let node_os = require("node:os");
38
38
  let node_fs = require("node:fs");
39
39
  let node_path = require("node:path");
40
40
  node_path = __toESM(node_path);
41
- //#region ../types/dist/event-category-BZL-fdNj.mjs
41
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -410,6 +410,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
410
410
  */
411
411
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
412
412
  /**
413
+ * Cap event fired by every device that registers the `network-link`
414
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
415
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
416
+ * reading that moved.
417
+ */
418
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
419
+ /**
413
420
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
414
421
  * "wake in progress" window — between the Baichuan wake-up issue and
415
422
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23992,6 +23999,88 @@ onStatusChanged: { data: object({
23992
23999
  volatileStateFields: ["lastUpdated"]
23993
24000
  };
23994
24001
  /**
24002
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24003
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24004
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24005
+ * one Home Assistant projection.
24006
+ */
24007
+ var NetworkLinkStatusSchema = object({
24008
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24009
+ type: _enum([
24010
+ "wifi",
24011
+ "ethernet",
24012
+ "cellular",
24013
+ "unknown"
24014
+ ]),
24015
+ /**
24016
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24017
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24018
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24019
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24020
+ * SKIP a null rather than coerce it.
24021
+ */
24022
+ signalPercent: number().min(0).max(100).nullable(),
24023
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24024
+ rssiDbm: number().optional(),
24025
+ /** Network name of a wireless link, when the firmware reports it. */
24026
+ ssid: string().optional(),
24027
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24028
+ lastUpdated: number()
24029
+ });
24030
+ var networkLinkCapability = {
24031
+ name: "network-link",
24032
+ scope: "device",
24033
+ deviceNative: true,
24034
+ mode: "singleton",
24035
+ deviceTypes: [
24036
+ DeviceType.Camera,
24037
+ DeviceType.Sensor,
24038
+ DeviceType.Button,
24039
+ DeviceType.Switch,
24040
+ DeviceType.Light,
24041
+ DeviceType.Lock,
24042
+ DeviceType.Siren
24043
+ ],
24044
+ methods: {},
24045
+ events: {
24046
+ /**
24047
+ * Emitted whenever the cached status changes (a link switch, a signal
24048
+ * reading that moved). Mirrored on the parent chain by the
24049
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24050
+ */
24051
+ onStatusChanged: { data: object({
24052
+ deviceId: number(),
24053
+ status: NetworkLinkStatusSchema
24054
+ }) } },
24055
+ status: {
24056
+ schema: NetworkLinkStatusSchema,
24057
+ kind: "push",
24058
+ empty: {
24059
+ type: "unknown",
24060
+ signalPercent: null,
24061
+ lastUpdated: 0
24062
+ }
24063
+ },
24064
+ /**
24065
+ * Runtime-state slice — every provider stores the same shape under
24066
+ * `device.runtimeState['network-link']`, read once by the badge and the
24067
+ * Home Assistant projector regardless of the driver.
24068
+ */
24069
+ runtimeState: NetworkLinkStatusSchema,
24070
+ /**
24071
+ * Runtime-state durability: **restored** — a link reading is slow to
24072
+ * change and a sleeping battery camera may not report for hours; the
24073
+ * restored slice is what the badge shows until the next read.
24074
+ *
24075
+ * See `RuntimeStateDurability`. Enforced by
24076
+ * `scripts/check-runtime-state-durability.ts`.
24077
+ */
24078
+ durability: "restored",
24079
+ /** Clock fields: written, but excluded from the compare that decides
24080
+ * whether persisting is worth a SQLite commit. */
24081
+ volatileStateFields: ["lastUpdated"]
24082
+ };
24083
+ /**
23995
24084
  * Generic boolean sensor — last-resort fallback when no domain-
23996
24085
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23997
24086
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32393,6 +32482,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32393
32482
  motionTrigger: motionTriggerCapability,
32394
32483
  motionZones: motionZonesCapability,
32395
32484
  nativeObjectDetection: nativeObjectDetectionCapability,
32485
+ networkLink: networkLinkCapability,
32396
32486
  notifier: notifierCapability,
32397
32487
  numericSensor: numericSensorCapability,
32398
32488
  petFeeder: petFeederCapability,
package/dist/addon.mjs CHANGED
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
39
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
40
  //#endregion
41
- //#region ../types/dist/event-category-BZL-fdNj.mjs
41
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -410,6 +410,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
410
410
  */
411
411
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
412
412
  /**
413
+ * Cap event fired by every device that registers the `network-link`
414
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
415
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
416
+ * reading that moved.
417
+ */
418
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
419
+ /**
413
420
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
414
421
  * "wake in progress" window — between the Baichuan wake-up issue and
415
422
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23992,6 +23999,88 @@ onStatusChanged: { data: object({
23992
23999
  volatileStateFields: ["lastUpdated"]
23993
24000
  };
23994
24001
  /**
24002
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24003
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24004
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24005
+ * one Home Assistant projection.
24006
+ */
24007
+ var NetworkLinkStatusSchema = object({
24008
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24009
+ type: _enum([
24010
+ "wifi",
24011
+ "ethernet",
24012
+ "cellular",
24013
+ "unknown"
24014
+ ]),
24015
+ /**
24016
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24017
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24018
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24019
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24020
+ * SKIP a null rather than coerce it.
24021
+ */
24022
+ signalPercent: number().min(0).max(100).nullable(),
24023
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24024
+ rssiDbm: number().optional(),
24025
+ /** Network name of a wireless link, when the firmware reports it. */
24026
+ ssid: string().optional(),
24027
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24028
+ lastUpdated: number()
24029
+ });
24030
+ var networkLinkCapability = {
24031
+ name: "network-link",
24032
+ scope: "device",
24033
+ deviceNative: true,
24034
+ mode: "singleton",
24035
+ deviceTypes: [
24036
+ DeviceType.Camera,
24037
+ DeviceType.Sensor,
24038
+ DeviceType.Button,
24039
+ DeviceType.Switch,
24040
+ DeviceType.Light,
24041
+ DeviceType.Lock,
24042
+ DeviceType.Siren
24043
+ ],
24044
+ methods: {},
24045
+ events: {
24046
+ /**
24047
+ * Emitted whenever the cached status changes (a link switch, a signal
24048
+ * reading that moved). Mirrored on the parent chain by the
24049
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24050
+ */
24051
+ onStatusChanged: { data: object({
24052
+ deviceId: number(),
24053
+ status: NetworkLinkStatusSchema
24054
+ }) } },
24055
+ status: {
24056
+ schema: NetworkLinkStatusSchema,
24057
+ kind: "push",
24058
+ empty: {
24059
+ type: "unknown",
24060
+ signalPercent: null,
24061
+ lastUpdated: 0
24062
+ }
24063
+ },
24064
+ /**
24065
+ * Runtime-state slice — every provider stores the same shape under
24066
+ * `device.runtimeState['network-link']`, read once by the badge and the
24067
+ * Home Assistant projector regardless of the driver.
24068
+ */
24069
+ runtimeState: NetworkLinkStatusSchema,
24070
+ /**
24071
+ * Runtime-state durability: **restored** — a link reading is slow to
24072
+ * change and a sleeping battery camera may not report for hours; the
24073
+ * restored slice is what the badge shows until the next read.
24074
+ *
24075
+ * See `RuntimeStateDurability`. Enforced by
24076
+ * `scripts/check-runtime-state-durability.ts`.
24077
+ */
24078
+ durability: "restored",
24079
+ /** Clock fields: written, but excluded from the compare that decides
24080
+ * whether persisting is worth a SQLite commit. */
24081
+ volatileStateFields: ["lastUpdated"]
24082
+ };
24083
+ /**
23995
24084
  * Generic boolean sensor — last-resort fallback when no domain-
23996
24085
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23997
24086
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32393,6 +32482,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32393
32482
  motionTrigger: motionTriggerCapability,
32394
32483
  motionZones: motionZonesCapability,
32395
32484
  nativeObjectDetection: nativeObjectDetectionCapability,
32485
+ networkLink: networkLinkCapability,
32396
32486
  notifier: notifierCapability,
32397
32487
  numericSensor: numericSensorCapability,
32398
32488
  petFeeder: petFeederCapability,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.68",
3
+ "version": "0.2.69",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",