@camstack/addon-provider-homeassistant 1.2.37 → 1.2.38

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-Cnf3N7Ug.js");
2
+ const require_dist = require("./dist-3KejG9q2.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 pressureSensorCapability, A as coverCapability, B as imageCapability, C as buttonCapability, Ct as record, D as connectivityCapability, Dt as url, E as colorCapability, Et as unknown, F as fanControlCapability, G as normalizeUnit, H as lockControlCapability, I as floodCapability, J as numericSensorCapability, K as notificationOutputCapability, L as gasCapability, N as enumSensorCapability, O as contactCapability, Ot as EventCategory, P as eventEmitterCapability, Q as presenceCapability, R as humidifierCapability, S as buildAddonRouteProvider, St as object, T as climateControlCapability, Tt as union, U as mediaPlayerCapability, V as lawnMowerControlCapability, W as motionCapability, X as powerMeterCapability, Z as prepareNotification, _ as batteryCapability, _t as _enum, at as updateCapability, b as brightnessCapability, bt as literal, ct as vibrationCapability, d as accessoriesCapability, dt as errMsg, et as scriptRunnerCapability, f as addonRoutesCapability, g as automationControlCapability, gt as createEvent, h as ambientLightSensorCapability, ht as DeviceType, it as temperatureSensorCapability, j as deviceAdoptionCapability, k as controlCapability, lt as waterHeaterCapability, m as alarmPanelCapability, mt as DeviceRole, n as BaseDevice, nt as switchCapability, o as EnumSensorDateTimeFormatSchema, ot as vacuumControlCapability, p as airQualitySensorCapability, pt as DeviceFeature, q as notifierCapability, r as BaseDeviceProvider, rt as tamperCapability, st as valveCapability, tt as smokeCapability, u as TargetSchema, ut as weatherCapability, v as bestLocationMatch, vt as array, w as carbonMonoxideCapability, wt as string, x as brokerCapability, xt as number, y as binaryCapability, yt as discriminatedUnion, z as humiditySensorCapability } from "./dist-CZfScvEk.mjs";
1
+ import { $ as pressureSensorCapability, A as coverCapability, B as imageCapability, C as buttonCapability, Ct as record, D as connectivityCapability, Dt as url, E as colorCapability, Et as unknown, F as fanControlCapability, G as normalizeUnit, H as lockControlCapability, I as floodCapability, J as numericSensorCapability, K as notificationOutputCapability, L as gasCapability, N as enumSensorCapability, O as contactCapability, Ot as EventCategory, P as eventEmitterCapability, Q as presenceCapability, R as humidifierCapability, S as buildAddonRouteProvider, St as object, T as climateControlCapability, Tt as union, U as mediaPlayerCapability, V as lawnMowerControlCapability, W as motionCapability, X as powerMeterCapability, Z as prepareNotification, _ as batteryCapability, _t as _enum, at as updateCapability, b as brightnessCapability, bt as literal, ct as vibrationCapability, d as accessoriesCapability, dt as errMsg, et as scriptRunnerCapability, f as addonRoutesCapability, g as automationControlCapability, gt as createEvent, h as ambientLightSensorCapability, ht as DeviceType, it as temperatureSensorCapability, j as deviceAdoptionCapability, k as controlCapability, lt as waterHeaterCapability, m as alarmPanelCapability, mt as DeviceRole, n as BaseDevice, nt as switchCapability, o as EnumSensorDateTimeFormatSchema, ot as vacuumControlCapability, p as airQualitySensorCapability, pt as DeviceFeature, q as notifierCapability, r as BaseDeviceProvider, rt as tamperCapability, st as valveCapability, tt as smokeCapability, u as TargetSchema, ut as weatherCapability, v as bestLocationMatch, vt as array, w as carbonMonoxideCapability, wt as string, x as brokerCapability, xt as number, y as binaryCapability, yt as discriminatedUnion, z as humiditySensorCapability } from "./dist-CJ3sUHKH.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
@@ -19274,6 +19274,12 @@ var CameraStatusSchema = object({
19274
19274
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19275
19275
  fetchedAt: number()
19276
19276
  });
19277
+ var InferenceDeviceExclusionReasonSchema = _enum([
19278
+ "disabled",
19279
+ "unavailable",
19280
+ "cannot-host-camera-root",
19281
+ "accelerator-preferred"
19282
+ ]);
19277
19283
  var NodeInferenceDeviceSchema = object({
19278
19284
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19279
19285
  key: string(),
@@ -19304,7 +19310,17 @@ var NodeInferenceDeviceSchema = object({
19304
19310
  * available per format; this is the stored selection that becomes the
19305
19311
  * default for EVERY camera landing on this accelerator.
19306
19312
  */
19307
- steps: record(string(), DeviceStepConfigSchema).optional()
19313
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19314
+ /**
19315
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19316
+ * the reason the dispatcher drops it. Computed by the SAME
19317
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19318
+ * never disagree with the election — deriving it in the UI from
19319
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19320
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19321
+ * "an accelerator is serving" predicate).
19322
+ */
19323
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19308
19324
  });
19309
19325
  var NodeInferenceDevicesSchema = object({
19310
19326
  nodeId: string(),
@@ -24244,7 +24260,12 @@ var ListResultSchema = object({
24244
24260
  probedAt: number()
24245
24261
  });
24246
24262
  var PreferredSchema = LocalInterfaceSchema.nullable();
24247
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24263
+ /**
24264
+ * Candidate base URL for the SDK to race on connect. Order matters —
24265
+ * the SDK should attempt these top-to-bottom with a short per-candidate
24266
+ * timeout (e.g. 1500ms) and cache the winner for the session.
24267
+ */
24268
+ var ConnectionEndpointSchema = object({
24248
24269
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
24249
24270
  label: string(),
24250
24271
  /** Fully-formed base URL with scheme + host + port. */
@@ -24287,7 +24308,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24287
24308
  * ordering between polls.
24288
24309
  */
24289
24310
  priority: number()
24290
- })).readonly() });
24311
+ });
24312
+ /**
24313
+ * Where the advertised local port came from. Ordered most → least
24314
+ * authoritative, and the whole point of returning it: a client must be able to
24315
+ * tell a FACT about the hub's socket from an echo of its own guess.
24316
+ */
24317
+ var LocalPortSourceEnum = _enum([
24318
+ "server-config",
24319
+ "server-env",
24320
+ "caller-hint",
24321
+ "default"
24322
+ ]);
24323
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24324
+ var AdvertisedLocalPortSchema = object({
24325
+ port: number().int().min(1).max(65535),
24326
+ source: LocalPortSourceEnum
24327
+ });
24328
+ var GetConnectionEndpointsResultSchema = object({
24329
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24330
+ /**
24331
+ * The port the hub built the LAN/loopback URLs with, and where that number
24332
+ * came from.
24333
+ *
24334
+ * Returned rather than merely applied, because "the URL is right" and "the
24335
+ * client can KNOW the URL is right" are different properties. A client that
24336
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24337
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24338
+ * race the candidate or discard it. With `source` it can: anything but
24339
+ * `caller-hint` is the hub's own socket.
24340
+ *
24341
+ * Absent on hubs predating this field — a client that finds it missing is
24342
+ * talking to an echoing hub and must degrade exactly as it does for
24343
+ * `caller-hint`.
24344
+ */
24345
+ localPort: AdvertisedLocalPortSchema
24346
+ });
24291
24347
  /**
24292
24348
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24293
24349
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24308,8 +24364,13 @@ var AllowedAddressesSchema = object({
24308
24364
  */
24309
24365
  addresses: array(string()).readonly() });
24310
24366
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24311
- /** Local hub HTTP port to use in base URLs. */
24312
- port: number().int().min(1).max(65535),
24367
+ /**
24368
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24369
+ * written against the echoing contract keep working; the hub uses it
24370
+ * only when it cannot read its own port, and says so via
24371
+ * `localPort.source === 'caller-hint'`.
24372
+ */
24373
+ port: number().int().min(1).max(65535).optional(),
24313
24374
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24314
24375
  * candidate. Default `true`. */
24315
24376
  includeLoopback: boolean().optional(),
@@ -19274,6 +19274,12 @@ var CameraStatusSchema = object({
19274
19274
  /** Unix timestamp (ms) when this snapshot was composed server-side. */
19275
19275
  fetchedAt: number()
19276
19276
  });
19277
+ var InferenceDeviceExclusionReasonSchema = _enum([
19278
+ "disabled",
19279
+ "unavailable",
19280
+ "cannot-host-camera-root",
19281
+ "accelerator-preferred"
19282
+ ]);
19277
19283
  var NodeInferenceDeviceSchema = object({
19278
19284
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
19279
19285
  key: string(),
@@ -19304,7 +19310,17 @@ var NodeInferenceDeviceSchema = object({
19304
19310
  * available per format; this is the stored selection that becomes the
19305
19311
  * default for EVERY camera landing on this accelerator.
19306
19312
  */
19307
- steps: record(string(), DeviceStepConfigSchema).optional()
19313
+ steps: record(string(), DeviceStepConfigSchema).optional(),
19314
+ /**
19315
+ * `null` when the device IS a camera-root candidate on this node; otherwise
19316
+ * the reason the dispatcher drops it. Computed by the SAME
19317
+ * `resolveInferenceDeviceEligibility` the dispatcher runs, so this view can
19318
+ * never disagree with the election — deriving it in the UI from
19319
+ * `enabled`/`available` would silently miss `cannot-host-camera-root` (needs
19320
+ * the node's model catalog) and `accelerator-preferred` (needs the node-wide
19321
+ * "an accelerator is serving" predicate).
19322
+ */
19323
+ exclusion: InferenceDeviceExclusionReasonSchema.nullable()
19308
19324
  });
19309
19325
  var NodeInferenceDevicesSchema = object({
19310
19326
  nodeId: string(),
@@ -24244,7 +24260,12 @@ var ListResultSchema = object({
24244
24260
  probedAt: number()
24245
24261
  });
24246
24262
  var PreferredSchema = LocalInterfaceSchema.nullable();
24247
- var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24263
+ /**
24264
+ * Candidate base URL for the SDK to race on connect. Order matters —
24265
+ * the SDK should attempt these top-to-bottom with a short per-candidate
24266
+ * timeout (e.g. 1500ms) and cache the winner for the session.
24267
+ */
24268
+ var ConnectionEndpointSchema = object({
24248
24269
  /** Operator-facing label (e.g. "LAN — en0", "Public tunnel"). */
24249
24270
  label: string(),
24250
24271
  /** Fully-formed base URL with scheme + host + port. */
@@ -24287,7 +24308,42 @@ var GetConnectionEndpointsResultSchema = object({ endpoints: array(object({
24287
24308
  * ordering between polls.
24288
24309
  */
24289
24310
  priority: number()
24290
- })).readonly() });
24311
+ });
24312
+ /**
24313
+ * Where the advertised local port came from. Ordered most → least
24314
+ * authoritative, and the whole point of returning it: a client must be able to
24315
+ * tell a FACT about the hub's socket from an echo of its own guess.
24316
+ */
24317
+ var LocalPortSourceEnum = _enum([
24318
+ "server-config",
24319
+ "server-env",
24320
+ "caller-hint",
24321
+ "default"
24322
+ ]);
24323
+ /** The port every LAN/loopback `baseUrl` in the same result was built with. */
24324
+ var AdvertisedLocalPortSchema = object({
24325
+ port: number().int().min(1).max(65535),
24326
+ source: LocalPortSourceEnum
24327
+ });
24328
+ var GetConnectionEndpointsResultSchema = object({
24329
+ endpoints: array(ConnectionEndpointSchema).readonly(),
24330
+ /**
24331
+ * The port the hub built the LAN/loopback URLs with, and where that number
24332
+ * came from.
24333
+ *
24334
+ * Returned rather than merely applied, because "the URL is right" and "the
24335
+ * client can KNOW the URL is right" are different properties. A client that
24336
+ * only sees a corrected URL cannot distinguish a hub that fixed the port from
24337
+ * a hub that echoed the port the client sent, so it cannot decide whether to
24338
+ * race the candidate or discard it. With `source` it can: anything but
24339
+ * `caller-hint` is the hub's own socket.
24340
+ *
24341
+ * Absent on hubs predating this field — a client that finds it missing is
24342
+ * talking to an echoing hub and must degrade exactly as it does for
24343
+ * `caller-hint`.
24344
+ */
24345
+ localPort: AdvertisedLocalPortSchema
24346
+ });
24291
24347
  /**
24292
24348
  * The chosen outbound endpoint for notification artifacts. `baseUrl: null` =
24293
24349
  * AUTO (resolved from the candidate ranking at send time); `resolved` reports
@@ -24308,8 +24364,13 @@ var AllowedAddressesSchema = object({
24308
24364
  */
24309
24365
  addresses: array(string()).readonly() });
24310
24366
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
24311
- /** Local hub HTTP port to use in base URLs. */
24312
- port: number().int().min(1).max(65535),
24367
+ /**
24368
+ * LEGACY HINT — do not send from new code. Kept optional so clients
24369
+ * written against the echoing contract keep working; the hub uses it
24370
+ * only when it cannot read its own port, and says so via
24371
+ * `localPort.source === 'caller-hint'`.
24372
+ */
24373
+ port: number().int().min(1).max(65535).optional(),
24313
24374
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24314
24375
  * candidate. Default `true`. */
24315
24376
  includeLoopback: boolean().optional(),
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-Cnf3N7Ug.js");
6
+ const require_dist = require("../dist-3KejG9q2.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { M as deviceExportCapability, Ot as EventCategory, S as buildAddonRouteProvider, Y as oauthIntegrationCapability, a as CameraSwitchIdSchema, c as HvacModeSchema, f as addonRoutesCapability, ft as BaseAddon, i as COCO_TO_MACRO, l as MediaPlayerRepeatSchema, s as FanDirectionSchema, t as AlarmArmModeSchema, wt as string } from "../dist-CZfScvEk.mjs";
1
+ import { M as deviceExportCapability, Ot as EventCategory, S as buildAddonRouteProvider, Y as oauthIntegrationCapability, a as CameraSwitchIdSchema, c as HvacModeSchema, f as addonRoutesCapability, ft as BaseAddon, i as COCO_TO_MACRO, l as MediaPlayerRepeatSchema, s as FanDirectionSchema, t as AlarmArmModeSchema, wt as string } from "../dist-CJ3sUHKH.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",