@camstack/addon-provider-homeassistant 1.2.84 → 1.2.86

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-CcOZqeLH.js");
2
+ const require_dist = require("./dist-lHF9qIyU.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-device-source.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-CqiUtzgT.mjs";
1
+ import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-l3fKSOoz.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-device-source.ts
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BZL-fdNj.mjs
1
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -370,6 +370,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
370
370
  */
371
371
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
372
372
  /**
373
+ * Cap event fired by every device that registers the `network-link`
374
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
375
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
376
+ * reading that moved.
377
+ */
378
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
379
+ /**
373
380
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
374
381
  * "wake in progress" window — between the Baichuan wake-up issue and
375
382
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19777,6 +19784,33 @@ var RecentTracksQueryInput = object({
19777
19784
  */
19778
19785
  classes: array(string()).optional()
19779
19786
  });
19787
+ /**
19788
+ * A Summary (D359): the per-camera session envelope that references tracks.
19789
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19790
+ * served by the event-media plane by key), null until the first frame with a
19791
+ * member visible has been materialised.
19792
+ */
19793
+ var SummarySchema = object({
19794
+ id: string(),
19795
+ deviceId: number(),
19796
+ openedAt: number(),
19797
+ lastActiveAt: number(),
19798
+ sealedAt: number().nullable(),
19799
+ memberCount: number().int().nonnegative(),
19800
+ groupShotKey: string().nullable()
19801
+ });
19802
+ var SummariesQueryInput = object({
19803
+ deviceIds: array(number()).min(1),
19804
+ since: number().optional(),
19805
+ until: number().optional(),
19806
+ limit: number().int().min(1).max(200).default(50)
19807
+ });
19808
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19809
+ var SummaryDetailSchema = object({
19810
+ summary: SummarySchema,
19811
+ /** Member track ids, in absorption order. */
19812
+ trackIds: array(string()).readonly()
19813
+ });
19780
19814
  var RecentTracksPageSchema = object({
19781
19815
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19782
19816
  tracks: array(TrackSchema).readonly(),
@@ -20177,7 +20211,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20177
20211
  * timeline would read as a camera that saw nothing.
20178
20212
  */
20179
20213
  classes: array(string()).optional()
20180
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20214
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20181
20215
  kind: "mutation",
20182
20216
  auth: "admin"
20183
20217
  }), 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({
@@ -24182,6 +24216,88 @@ onStatusChanged: { data: object({
24182
24216
  volatileStateFields: ["lastUpdated"]
24183
24217
  };
24184
24218
  /**
24219
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24220
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24221
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24222
+ * one Home Assistant projection.
24223
+ */
24224
+ var NetworkLinkStatusSchema = object({
24225
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24226
+ type: _enum([
24227
+ "wifi",
24228
+ "ethernet",
24229
+ "cellular",
24230
+ "unknown"
24231
+ ]),
24232
+ /**
24233
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24234
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24235
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24236
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24237
+ * SKIP a null rather than coerce it.
24238
+ */
24239
+ signalPercent: number().min(0).max(100).nullable(),
24240
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24241
+ rssiDbm: number().optional(),
24242
+ /** Network name of a wireless link, when the firmware reports it. */
24243
+ ssid: string().optional(),
24244
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24245
+ lastUpdated: number()
24246
+ });
24247
+ var networkLinkCapability = {
24248
+ name: "network-link",
24249
+ scope: "device",
24250
+ deviceNative: true,
24251
+ mode: "singleton",
24252
+ deviceTypes: [
24253
+ DeviceType.Camera,
24254
+ DeviceType.Sensor,
24255
+ DeviceType.Button,
24256
+ DeviceType.Switch,
24257
+ DeviceType.Light,
24258
+ DeviceType.Lock,
24259
+ DeviceType.Siren
24260
+ ],
24261
+ methods: {},
24262
+ events: {
24263
+ /**
24264
+ * Emitted whenever the cached status changes (a link switch, a signal
24265
+ * reading that moved). Mirrored on the parent chain by the
24266
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24267
+ */
24268
+ onStatusChanged: { data: object({
24269
+ deviceId: number(),
24270
+ status: NetworkLinkStatusSchema
24271
+ }) } },
24272
+ status: {
24273
+ schema: NetworkLinkStatusSchema,
24274
+ kind: "push",
24275
+ empty: {
24276
+ type: "unknown",
24277
+ signalPercent: null,
24278
+ lastUpdated: 0
24279
+ }
24280
+ },
24281
+ /**
24282
+ * Runtime-state slice — every provider stores the same shape under
24283
+ * `device.runtimeState['network-link']`, read once by the badge and the
24284
+ * Home Assistant projector regardless of the driver.
24285
+ */
24286
+ runtimeState: NetworkLinkStatusSchema,
24287
+ /**
24288
+ * Runtime-state durability: **restored** — a link reading is slow to
24289
+ * change and a sleeping battery camera may not report for hours; the
24290
+ * restored slice is what the badge shows until the next read.
24291
+ *
24292
+ * See `RuntimeStateDurability`. Enforced by
24293
+ * `scripts/check-runtime-state-durability.ts`.
24294
+ */
24295
+ durability: "restored",
24296
+ /** Clock fields: written, but excluded from the compare that decides
24297
+ * whether persisting is worth a SQLite commit. */
24298
+ volatileStateFields: ["lastUpdated"]
24299
+ };
24300
+ /**
24185
24301
  * Generic boolean sensor — last-resort fallback when no domain-
24186
24302
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24187
24303
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32583,6 +32699,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32583
32699
  motionTrigger: motionTriggerCapability,
32584
32700
  motionZones: motionZonesCapability,
32585
32701
  nativeObjectDetection: nativeObjectDetectionCapability,
32702
+ networkLink: networkLinkCapability,
32586
32703
  notifier: notifierCapability,
32587
32704
  numericSensor: numericSensorCapability,
32588
32705
  petFeeder: petFeederCapability,
@@ -37000,6 +37117,12 @@ Object.freeze({
37000
37117
  addonId: null,
37001
37118
  access: "view"
37002
37119
  },
37120
+ "pipelineAnalytics.getSummary": {
37121
+ capName: "pipeline-analytics",
37122
+ capScope: "device",
37123
+ addonId: null,
37124
+ access: "view"
37125
+ },
37003
37126
  "pipelineAnalytics.getTrack": {
37004
37127
  capName: "pipeline-analytics",
37005
37128
  capScope: "device",
@@ -37078,6 +37201,12 @@ Object.freeze({
37078
37201
  addonId: null,
37079
37202
  access: "view"
37080
37203
  },
37204
+ "pipelineAnalytics.listSummaries": {
37205
+ capName: "pipeline-analytics",
37206
+ capScope: "device",
37207
+ addonId: null,
37208
+ access: "view"
37209
+ },
37081
37210
  "pipelineAnalytics.listTrackMedia": {
37082
37211
  capName: "pipeline-analytics",
37083
37212
  capScope: "device",
@@ -40773,6 +40902,11 @@ Object.freeze({
40773
40902
  form: "array",
40774
40903
  optional: true
40775
40904
  }],
40905
+ "pipelineAnalytics.listSummaries": [{
40906
+ name: "deviceIds",
40907
+ form: "array",
40908
+ optional: false
40909
+ }],
40776
40910
  "pipelineAnalytics.listTrackMedia": [{
40777
40911
  name: "deviceId",
40778
40912
  form: "single",
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BZL-fdNj.mjs
1
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -370,6 +370,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
370
370
  */
371
371
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
372
372
  /**
373
+ * Cap event fired by every device that registers the `network-link`
374
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
375
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
376
+ * reading that moved.
377
+ */
378
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
379
+ /**
373
380
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
374
381
  * "wake in progress" window — between the Baichuan wake-up issue and
375
382
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19777,6 +19784,33 @@ var RecentTracksQueryInput = object({
19777
19784
  */
19778
19785
  classes: array(string()).optional()
19779
19786
  });
19787
+ /**
19788
+ * A Summary (D359): the per-camera session envelope that references tracks.
19789
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19790
+ * served by the event-media plane by key), null until the first frame with a
19791
+ * member visible has been materialised.
19792
+ */
19793
+ var SummarySchema = object({
19794
+ id: string(),
19795
+ deviceId: number(),
19796
+ openedAt: number(),
19797
+ lastActiveAt: number(),
19798
+ sealedAt: number().nullable(),
19799
+ memberCount: number().int().nonnegative(),
19800
+ groupShotKey: string().nullable()
19801
+ });
19802
+ var SummariesQueryInput = object({
19803
+ deviceIds: array(number()).min(1),
19804
+ since: number().optional(),
19805
+ until: number().optional(),
19806
+ limit: number().int().min(1).max(200).default(50)
19807
+ });
19808
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19809
+ var SummaryDetailSchema = object({
19810
+ summary: SummarySchema,
19811
+ /** Member track ids, in absorption order. */
19812
+ trackIds: array(string()).readonly()
19813
+ });
19780
19814
  var RecentTracksPageSchema = object({
19781
19815
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19782
19816
  tracks: array(TrackSchema).readonly(),
@@ -20177,7 +20211,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20177
20211
  * timeline would read as a camera that saw nothing.
20178
20212
  */
20179
20213
  classes: array(string()).optional()
20180
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20214
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20181
20215
  kind: "mutation",
20182
20216
  auth: "admin"
20183
20217
  }), 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({
@@ -24182,6 +24216,88 @@ onStatusChanged: { data: object({
24182
24216
  volatileStateFields: ["lastUpdated"]
24183
24217
  };
24184
24218
  /**
24219
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24220
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24221
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24222
+ * one Home Assistant projection.
24223
+ */
24224
+ var NetworkLinkStatusSchema = object({
24225
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24226
+ type: _enum([
24227
+ "wifi",
24228
+ "ethernet",
24229
+ "cellular",
24230
+ "unknown"
24231
+ ]),
24232
+ /**
24233
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24234
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24235
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24236
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24237
+ * SKIP a null rather than coerce it.
24238
+ */
24239
+ signalPercent: number().min(0).max(100).nullable(),
24240
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24241
+ rssiDbm: number().optional(),
24242
+ /** Network name of a wireless link, when the firmware reports it. */
24243
+ ssid: string().optional(),
24244
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24245
+ lastUpdated: number()
24246
+ });
24247
+ var networkLinkCapability = {
24248
+ name: "network-link",
24249
+ scope: "device",
24250
+ deviceNative: true,
24251
+ mode: "singleton",
24252
+ deviceTypes: [
24253
+ DeviceType.Camera,
24254
+ DeviceType.Sensor,
24255
+ DeviceType.Button,
24256
+ DeviceType.Switch,
24257
+ DeviceType.Light,
24258
+ DeviceType.Lock,
24259
+ DeviceType.Siren
24260
+ ],
24261
+ methods: {},
24262
+ events: {
24263
+ /**
24264
+ * Emitted whenever the cached status changes (a link switch, a signal
24265
+ * reading that moved). Mirrored on the parent chain by the
24266
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24267
+ */
24268
+ onStatusChanged: { data: object({
24269
+ deviceId: number(),
24270
+ status: NetworkLinkStatusSchema
24271
+ }) } },
24272
+ status: {
24273
+ schema: NetworkLinkStatusSchema,
24274
+ kind: "push",
24275
+ empty: {
24276
+ type: "unknown",
24277
+ signalPercent: null,
24278
+ lastUpdated: 0
24279
+ }
24280
+ },
24281
+ /**
24282
+ * Runtime-state slice — every provider stores the same shape under
24283
+ * `device.runtimeState['network-link']`, read once by the badge and the
24284
+ * Home Assistant projector regardless of the driver.
24285
+ */
24286
+ runtimeState: NetworkLinkStatusSchema,
24287
+ /**
24288
+ * Runtime-state durability: **restored** — a link reading is slow to
24289
+ * change and a sleeping battery camera may not report for hours; the
24290
+ * restored slice is what the badge shows until the next read.
24291
+ *
24292
+ * See `RuntimeStateDurability`. Enforced by
24293
+ * `scripts/check-runtime-state-durability.ts`.
24294
+ */
24295
+ durability: "restored",
24296
+ /** Clock fields: written, but excluded from the compare that decides
24297
+ * whether persisting is worth a SQLite commit. */
24298
+ volatileStateFields: ["lastUpdated"]
24299
+ };
24300
+ /**
24185
24301
  * Generic boolean sensor — last-resort fallback when no domain-
24186
24302
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24187
24303
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32583,6 +32699,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32583
32699
  motionTrigger: motionTriggerCapability,
32584
32700
  motionZones: motionZonesCapability,
32585
32701
  nativeObjectDetection: nativeObjectDetectionCapability,
32702
+ networkLink: networkLinkCapability,
32586
32703
  notifier: notifierCapability,
32587
32704
  numericSensor: numericSensorCapability,
32588
32705
  petFeeder: petFeederCapability,
@@ -37000,6 +37117,12 @@ Object.freeze({
37000
37117
  addonId: null,
37001
37118
  access: "view"
37002
37119
  },
37120
+ "pipelineAnalytics.getSummary": {
37121
+ capName: "pipeline-analytics",
37122
+ capScope: "device",
37123
+ addonId: null,
37124
+ access: "view"
37125
+ },
37003
37126
  "pipelineAnalytics.getTrack": {
37004
37127
  capName: "pipeline-analytics",
37005
37128
  capScope: "device",
@@ -37078,6 +37201,12 @@ Object.freeze({
37078
37201
  addonId: null,
37079
37202
  access: "view"
37080
37203
  },
37204
+ "pipelineAnalytics.listSummaries": {
37205
+ capName: "pipeline-analytics",
37206
+ capScope: "device",
37207
+ addonId: null,
37208
+ access: "view"
37209
+ },
37081
37210
  "pipelineAnalytics.listTrackMedia": {
37082
37211
  capName: "pipeline-analytics",
37083
37212
  capScope: "device",
@@ -40773,6 +40902,11 @@ Object.freeze({
40773
40902
  form: "array",
40774
40903
  optional: true
40775
40904
  }],
40905
+ "pipelineAnalytics.listSummaries": [{
40906
+ name: "deviceIds",
40907
+ form: "array",
40908
+ optional: false
40909
+ }],
40776
40910
  "pipelineAnalytics.listTrackMedia": [{
40777
40911
  name: "deviceId",
40778
40912
  form: "single",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-CcOZqeLH.js");
6
+ const require_dist = require("../dist-lHF9qIyU.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1333,6 +1333,22 @@ function cameraSpecs(device) {
1333
1333
  enabledByDefault: true
1334
1334
  }
1335
1335
  ];
1336
+ if (device.slices.includes("network-link")) specs.push({
1337
+ entity: "link",
1338
+ platform: "sensor",
1339
+ label: "Network link",
1340
+ icon: "mdi:lan-connect",
1341
+ entityCategory: "diagnostic",
1342
+ enabledByDefault: true
1343
+ }, {
1344
+ entity: "signal",
1345
+ platform: "sensor",
1346
+ label: "Signal",
1347
+ icon: "mdi:wifi",
1348
+ unit: "%",
1349
+ entityCategory: "diagnostic",
1350
+ enabledByDefault: true
1351
+ });
1336
1352
  if (device.slices.includes("battery")) specs.push({
1337
1353
  entity: "battery",
1338
1354
  platform: "sensor",
@@ -4982,6 +4998,25 @@ function projectBatterySlice(deviceKey, slice) {
4982
4998
  return values;
4983
4999
  }
4984
5000
  /**
5001
+ * The device's own link: which medium it is on and, for a wireless one, how
5002
+ * strong. An `unknown` type publishes nothing — it is the absence of a read,
5003
+ * and a wire drawn from it would be a lie the same way a 0 % battery was. A
5004
+ * `null` signal publishes no signal entity value: wired links have none, and
5005
+ * a wireless one not yet read must not sit at 0 %.
5006
+ */
5007
+ function projectNetworkLinkSlice(deviceKey, slice) {
5008
+ if (slice.type === "unknown") return [];
5009
+ const values = [{
5010
+ topic: stateTopic(deviceKey, "link"),
5011
+ value: slice.type
5012
+ }];
5013
+ if (slice.signalPercent !== null) values.push({
5014
+ topic: stateTopic(deviceKey, "signal"),
5015
+ value: String(Math.round(slice.signalPercent))
5016
+ });
5017
+ return values;
5018
+ }
5019
+ /**
4985
5020
  * The per-camera function switches, mirrored 1:1 from
4986
5021
  * `deriveCameraFunctions` (`camera-functions.ts`) — the pure derivation over
4987
5022
  * the AUTHORITIES that own each function, replacing the deprecated
@@ -6037,6 +6072,16 @@ var HaExportAddon = class extends require_dist.BaseAddon {
6037
6072
  if (typeof online === "boolean") this.push(deviceId, projectDeviceStatus(deviceKey, online));
6038
6073
  return;
6039
6074
  }
6075
+ if (capName === "network-link") {
6076
+ const type = readString(slice, "type");
6077
+ if (type === null) return;
6078
+ const signalPercent = readNumber(slice, "signalPercent");
6079
+ this.push(deviceId, projectNetworkLinkSlice(deviceKey, {
6080
+ type,
6081
+ signalPercent
6082
+ }));
6083
+ return;
6084
+ }
6040
6085
  if (capName === "battery") {
6041
6086
  const percentage = readNumber(slice, "percentage");
6042
6087
  const charging = readString(slice, "charging");
@@ -6800,6 +6845,14 @@ var HaExportAddon = class extends require_dist.BaseAddon {
6800
6845
  const snapshot = toSnapshot(snapshotRaw);
6801
6846
  const online = snapshot["device-status"]?.["online"];
6802
6847
  if (typeof online === "boolean") values.push(...projectDeviceStatus(key, online));
6848
+ const link = snapshot["network-link"];
6849
+ if (link !== void 0) {
6850
+ const type = readString(link, "type");
6851
+ if (type !== null) values.push(...projectNetworkLinkSlice(key, {
6852
+ type,
6853
+ signalPercent: readNumber(link, "signalPercent")
6854
+ }));
6855
+ }
6803
6856
  const battery = snapshot["battery"];
6804
6857
  if (battery !== void 0) {
6805
6858
  const percentage = readNumber(battery, "percentage");
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-CqiUtzgT.mjs";
1
+ import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-l3fKSOoz.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
@@ -1328,6 +1328,22 @@ function cameraSpecs(device) {
1328
1328
  enabledByDefault: true
1329
1329
  }
1330
1330
  ];
1331
+ if (device.slices.includes("network-link")) specs.push({
1332
+ entity: "link",
1333
+ platform: "sensor",
1334
+ label: "Network link",
1335
+ icon: "mdi:lan-connect",
1336
+ entityCategory: "diagnostic",
1337
+ enabledByDefault: true
1338
+ }, {
1339
+ entity: "signal",
1340
+ platform: "sensor",
1341
+ label: "Signal",
1342
+ icon: "mdi:wifi",
1343
+ unit: "%",
1344
+ entityCategory: "diagnostic",
1345
+ enabledByDefault: true
1346
+ });
1331
1347
  if (device.slices.includes("battery")) specs.push({
1332
1348
  entity: "battery",
1333
1349
  platform: "sensor",
@@ -4977,6 +4993,25 @@ function projectBatterySlice(deviceKey, slice) {
4977
4993
  return values;
4978
4994
  }
4979
4995
  /**
4996
+ * The device's own link: which medium it is on and, for a wireless one, how
4997
+ * strong. An `unknown` type publishes nothing — it is the absence of a read,
4998
+ * and a wire drawn from it would be a lie the same way a 0 % battery was. A
4999
+ * `null` signal publishes no signal entity value: wired links have none, and
5000
+ * a wireless one not yet read must not sit at 0 %.
5001
+ */
5002
+ function projectNetworkLinkSlice(deviceKey, slice) {
5003
+ if (slice.type === "unknown") return [];
5004
+ const values = [{
5005
+ topic: stateTopic(deviceKey, "link"),
5006
+ value: slice.type
5007
+ }];
5008
+ if (slice.signalPercent !== null) values.push({
5009
+ topic: stateTopic(deviceKey, "signal"),
5010
+ value: String(Math.round(slice.signalPercent))
5011
+ });
5012
+ return values;
5013
+ }
5014
+ /**
4980
5015
  * The per-camera function switches, mirrored 1:1 from
4981
5016
  * `deriveCameraFunctions` (`camera-functions.ts`) — the pure derivation over
4982
5017
  * the AUTHORITIES that own each function, replacing the deprecated
@@ -6032,6 +6067,16 @@ var HaExportAddon = class extends BaseAddon {
6032
6067
  if (typeof online === "boolean") this.push(deviceId, projectDeviceStatus(deviceKey, online));
6033
6068
  return;
6034
6069
  }
6070
+ if (capName === "network-link") {
6071
+ const type = readString(slice, "type");
6072
+ if (type === null) return;
6073
+ const signalPercent = readNumber(slice, "signalPercent");
6074
+ this.push(deviceId, projectNetworkLinkSlice(deviceKey, {
6075
+ type,
6076
+ signalPercent
6077
+ }));
6078
+ return;
6079
+ }
6035
6080
  if (capName === "battery") {
6036
6081
  const percentage = readNumber(slice, "percentage");
6037
6082
  const charging = readString(slice, "charging");
@@ -6795,6 +6840,14 @@ var HaExportAddon = class extends BaseAddon {
6795
6840
  const snapshot = toSnapshot(snapshotRaw);
6796
6841
  const online = snapshot["device-status"]?.["online"];
6797
6842
  if (typeof online === "boolean") values.push(...projectDeviceStatus(key, online));
6843
+ const link = snapshot["network-link"];
6844
+ if (link !== void 0) {
6845
+ const type = readString(link, "type");
6846
+ if (type !== null) values.push(...projectNetworkLinkSlice(key, {
6847
+ type,
6848
+ signalPercent: readNumber(link, "signalPercent")
6849
+ }));
6850
+ }
6798
6851
  const battery = snapshot["battery"];
6799
6852
  if (battery !== void 0) {
6800
6853
  const percentage = readNumber(battery, "percentage");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.84",
3
+ "version": "1.2.86",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",