@camstack/addon-provider-homematic 1.2.70 → 1.2.71

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
@@ -8,7 +8,7 @@ let http = require("http");
8
8
  let crypto$1 = require("crypto");
9
9
  let fs_promises = require("fs/promises");
10
10
  let path = require("path");
11
- //#region ../types/dist/event-category-BZL-fdNj.mjs
11
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -380,6 +380,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
380
380
  */
381
381
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
382
382
  /**
383
+ * Cap event fired by every device that registers the `network-link`
384
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
385
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
386
+ * reading that moved.
387
+ */
388
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
389
+ /**
383
390
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
384
391
  * "wake in progress" window — between the Baichuan wake-up issue and
385
392
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23824,6 +23831,88 @@ onStatusChanged: { data: object({
23824
23831
  volatileStateFields: ["lastUpdated"]
23825
23832
  };
23826
23833
  /**
23834
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23835
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23836
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23837
+ * one Home Assistant projection.
23838
+ */
23839
+ var NetworkLinkStatusSchema = object({
23840
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23841
+ type: _enum([
23842
+ "wifi",
23843
+ "ethernet",
23844
+ "cellular",
23845
+ "unknown"
23846
+ ]),
23847
+ /**
23848
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23849
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23850
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23851
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23852
+ * SKIP a null rather than coerce it.
23853
+ */
23854
+ signalPercent: number().min(0).max(100).nullable(),
23855
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23856
+ rssiDbm: number().optional(),
23857
+ /** Network name of a wireless link, when the firmware reports it. */
23858
+ ssid: string().optional(),
23859
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23860
+ lastUpdated: number()
23861
+ });
23862
+ var networkLinkCapability = {
23863
+ name: "network-link",
23864
+ scope: "device",
23865
+ deviceNative: true,
23866
+ mode: "singleton",
23867
+ deviceTypes: [
23868
+ DeviceType.Camera,
23869
+ DeviceType.Sensor,
23870
+ DeviceType.Button,
23871
+ DeviceType.Switch,
23872
+ DeviceType.Light,
23873
+ DeviceType.Lock,
23874
+ DeviceType.Siren
23875
+ ],
23876
+ methods: {},
23877
+ events: {
23878
+ /**
23879
+ * Emitted whenever the cached status changes (a link switch, a signal
23880
+ * reading that moved). Mirrored on the parent chain by the
23881
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23882
+ */
23883
+ onStatusChanged: { data: object({
23884
+ deviceId: number(),
23885
+ status: NetworkLinkStatusSchema
23886
+ }) } },
23887
+ status: {
23888
+ schema: NetworkLinkStatusSchema,
23889
+ kind: "push",
23890
+ empty: {
23891
+ type: "unknown",
23892
+ signalPercent: null,
23893
+ lastUpdated: 0
23894
+ }
23895
+ },
23896
+ /**
23897
+ * Runtime-state slice — every provider stores the same shape under
23898
+ * `device.runtimeState['network-link']`, read once by the badge and the
23899
+ * Home Assistant projector regardless of the driver.
23900
+ */
23901
+ runtimeState: NetworkLinkStatusSchema,
23902
+ /**
23903
+ * Runtime-state durability: **restored** — a link reading is slow to
23904
+ * change and a sleeping battery camera may not report for hours; the
23905
+ * restored slice is what the badge shows until the next read.
23906
+ *
23907
+ * See `RuntimeStateDurability`. Enforced by
23908
+ * `scripts/check-runtime-state-durability.ts`.
23909
+ */
23910
+ durability: "restored",
23911
+ /** Clock fields: written, but excluded from the compare that decides
23912
+ * whether persisting is worth a SQLite commit. */
23913
+ volatileStateFields: ["lastUpdated"]
23914
+ };
23915
+ /**
23827
23916
  * Generic boolean sensor — last-resort fallback when no domain-
23828
23917
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23829
23918
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32208,6 +32297,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32208
32297
  motionTrigger: motionTriggerCapability,
32209
32298
  motionZones: motionZonesCapability,
32210
32299
  nativeObjectDetection: nativeObjectDetectionCapability,
32300
+ networkLink: networkLinkCapability,
32211
32301
  notifier: notifierCapability,
32212
32302
  numericSensor: numericSensorCapability,
32213
32303
  petFeeder: petFeederCapability,
package/dist/addon.mjs CHANGED
@@ -9,7 +9,7 @@ import { join } from "path";
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
11
  //#endregion
12
- //#region ../types/dist/event-category-BZL-fdNj.mjs
12
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
13
13
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  EventCategory["SystemBoot"] = "system.boot";
15
15
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -381,6 +381,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
381
381
  */
382
382
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
383
383
  /**
384
+ * Cap event fired by every device that registers the `network-link`
385
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
386
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
387
+ * reading that moved.
388
+ */
389
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
390
+ /**
384
391
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
385
392
  * "wake in progress" window — between the Baichuan wake-up issue and
386
393
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23825,6 +23832,88 @@ onStatusChanged: { data: object({
23825
23832
  volatileStateFields: ["lastUpdated"]
23826
23833
  };
23827
23834
  /**
23835
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23836
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23837
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23838
+ * one Home Assistant projection.
23839
+ */
23840
+ var NetworkLinkStatusSchema = object({
23841
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23842
+ type: _enum([
23843
+ "wifi",
23844
+ "ethernet",
23845
+ "cellular",
23846
+ "unknown"
23847
+ ]),
23848
+ /**
23849
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23850
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23851
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23852
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23853
+ * SKIP a null rather than coerce it.
23854
+ */
23855
+ signalPercent: number().min(0).max(100).nullable(),
23856
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23857
+ rssiDbm: number().optional(),
23858
+ /** Network name of a wireless link, when the firmware reports it. */
23859
+ ssid: string().optional(),
23860
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23861
+ lastUpdated: number()
23862
+ });
23863
+ var networkLinkCapability = {
23864
+ name: "network-link",
23865
+ scope: "device",
23866
+ deviceNative: true,
23867
+ mode: "singleton",
23868
+ deviceTypes: [
23869
+ DeviceType.Camera,
23870
+ DeviceType.Sensor,
23871
+ DeviceType.Button,
23872
+ DeviceType.Switch,
23873
+ DeviceType.Light,
23874
+ DeviceType.Lock,
23875
+ DeviceType.Siren
23876
+ ],
23877
+ methods: {},
23878
+ events: {
23879
+ /**
23880
+ * Emitted whenever the cached status changes (a link switch, a signal
23881
+ * reading that moved). Mirrored on the parent chain by the
23882
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23883
+ */
23884
+ onStatusChanged: { data: object({
23885
+ deviceId: number(),
23886
+ status: NetworkLinkStatusSchema
23887
+ }) } },
23888
+ status: {
23889
+ schema: NetworkLinkStatusSchema,
23890
+ kind: "push",
23891
+ empty: {
23892
+ type: "unknown",
23893
+ signalPercent: null,
23894
+ lastUpdated: 0
23895
+ }
23896
+ },
23897
+ /**
23898
+ * Runtime-state slice — every provider stores the same shape under
23899
+ * `device.runtimeState['network-link']`, read once by the badge and the
23900
+ * Home Assistant projector regardless of the driver.
23901
+ */
23902
+ runtimeState: NetworkLinkStatusSchema,
23903
+ /**
23904
+ * Runtime-state durability: **restored** — a link reading is slow to
23905
+ * change and a sleeping battery camera may not report for hours; the
23906
+ * restored slice is what the badge shows until the next read.
23907
+ *
23908
+ * See `RuntimeStateDurability`. Enforced by
23909
+ * `scripts/check-runtime-state-durability.ts`.
23910
+ */
23911
+ durability: "restored",
23912
+ /** Clock fields: written, but excluded from the compare that decides
23913
+ * whether persisting is worth a SQLite commit. */
23914
+ volatileStateFields: ["lastUpdated"]
23915
+ };
23916
+ /**
23828
23917
  * Generic boolean sensor — last-resort fallback when no domain-
23829
23918
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23830
23919
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32209,6 +32298,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32209
32298
  motionTrigger: motionTriggerCapability,
32210
32299
  motionZones: motionZonesCapability,
32211
32300
  nativeObjectDetection: nativeObjectDetectionCapability,
32301
+ networkLink: networkLinkCapability,
32212
32302
  notifier: notifierCapability,
32213
32303
  numericSensor: numericSensorCapability,
32214
32304
  petFeeder: petFeederCapability,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homematic",
3
- "version": "1.2.70",
3
+ "version": "1.2.71",
4
4
  "description": "Homematic / HomematicIP (CCU3 / RaspberryMatic) device-provider addon for CamStack — wraps the nodehomematic library",
5
5
  "keywords": [
6
6
  "camstack",