@camstack/addon-provider-homeassistant 1.2.25 → 1.2.26

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-20wP9knC.js");
2
+ const require_dist = require("./dist-CmlVRSvD.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 tamperCapability, A as eventEmitterCapability, B as motionCapability, C as connectivityCapability, Ct as url, D as deviceAdoptionCapability, E as coverCapability, F as humiditySensorCapability, H as notificationOutputCapability, I as imageCapability, J as presenceCapability, K as powerMeterCapability, L as lawnMowerControlCapability, M as floodCapability, N as gasCapability, P as humidifierCapability, Q as switchCapability, R as lockControlCapability, S as colorCapability, St as unknown, T as controlCapability, U as notifierCapability, V as normalizeUnit, W as numericSensorCapability, X as scriptRunnerCapability, Y as pressureSensorCapability, Z as smokeCapability, _ as brokerCapability, _t as number, a as EnumSensorDateTimeFormatSchema, at as waterHeaterCapability, b as carbonMonoxideCapability, bt as string, c as addonRoutesCapability, d as ambientLightSensorCapability, dt as DeviceType, et as temperatureSensorCapability, f as automationControlCapability, ft as createEvent, g as brightnessCapability, gt as literal, h as binaryCapability, ht as discriminatedUnion, it as vibrationCapability, j as fanControlCapability, k as enumSensorCapability, l as airQualitySensorCapability, lt as DeviceFeature, m as bestLocationMatch, mt as array, n as BaseDeviceProvider, nt as vacuumControlCapability, o as TargetSchema, ot as weatherCapability, p as batteryCapability, pt as _enum, q as prepareNotification, rt as valveCapability, s as accessoriesCapability, st as errMsg, t as BaseDevice, tt as updateCapability, u as alarmPanelCapability, ut as DeviceRole, v as buildAddonRouteProvider, vt as object, w as contactCapability, wt as EventCategory, x as climateControlCapability, xt as union, y as buttonCapability, yt as record, z as mediaPlayerCapability } from "./dist-CKvJQg2D.mjs";
1
+ import { $ as tamperCapability, A as eventEmitterCapability, B as motionCapability, C as connectivityCapability, Ct as url, D as deviceAdoptionCapability, E as coverCapability, F as humiditySensorCapability, H as notificationOutputCapability, I as imageCapability, J as presenceCapability, K as powerMeterCapability, L as lawnMowerControlCapability, M as floodCapability, N as gasCapability, P as humidifierCapability, Q as switchCapability, R as lockControlCapability, S as colorCapability, St as unknown, T as controlCapability, U as notifierCapability, V as normalizeUnit, W as numericSensorCapability, X as scriptRunnerCapability, Y as pressureSensorCapability, Z as smokeCapability, _ as brokerCapability, _t as number, a as EnumSensorDateTimeFormatSchema, at as waterHeaterCapability, b as carbonMonoxideCapability, bt as string, c as addonRoutesCapability, d as ambientLightSensorCapability, dt as DeviceType, et as temperatureSensorCapability, f as automationControlCapability, ft as createEvent, g as brightnessCapability, gt as literal, h as binaryCapability, ht as discriminatedUnion, it as vibrationCapability, j as fanControlCapability, k as enumSensorCapability, l as airQualitySensorCapability, lt as DeviceFeature, m as bestLocationMatch, mt as array, n as BaseDeviceProvider, nt as vacuumControlCapability, o as TargetSchema, ot as weatherCapability, p as batteryCapability, pt as _enum, q as prepareNotification, rt as valveCapability, s as accessoriesCapability, st as errMsg, t as BaseDevice, tt as updateCapability, u as alarmPanelCapability, ut as DeviceRole, v as buildAddonRouteProvider, vt as object, w as contactCapability, wt as EventCategory, x as climateControlCapability, xt as union, y as buttonCapability, yt as record, z as mediaPlayerCapability } from "./dist-DC4EnKFm.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
@@ -25509,13 +25509,24 @@ method(object({
25509
25509
  /** Playback-speed multiplier for the render (1 = realtime). */
25510
25510
  var ExportSpeedSchema = number().min(.25).max(32);
25511
25511
  /**
25512
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25512
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25513
25513
  *
25514
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25515
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25516
- * playlist. Handing it absolute epochs would make every call site responsible
25517
- * for the same subtraction, and the one that forgot would emit a filter that
25518
- * selects nothing silently, as a uniform timelapse.
25514
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25515
+ * derives these bounds from things that happened at a TIME (a track's
25516
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25517
+ * every segment present for the range, with each recording GAP removed. The
25518
+ * two agree only on a window that recorded without one interruption, and only
25519
+ * the render side knows the segments, so the translation lives there
25520
+ * (`export-dense-map.ts`, addon-pipeline).
25521
+ *
25522
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25523
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25524
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25525
+ * the video was a uniform timelapse, and the log line reported the five ranges
25526
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25527
+ *
25528
+ * Relative and not absolute epoch, because an absolute epoch would make every
25529
+ * call site responsible for the same subtraction.
25519
25530
  */
25520
25531
  var ExportDenseRangeSchema = object({
25521
25532
  fromSec: number().nonnegative(),
@@ -34336,25 +34347,32 @@ object({
34336
34347
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34337
34348
  object({
34338
34349
  /**
34339
- * How long a retained native frame is served before it counts as a miss.
34350
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34351
+ * detection result.
34340
34352
  *
34341
- * Must cover the FULL late-crop horizon: detection inference + the
34342
- * cross-process inference-result hop to hub post-analysis + tracking + the
34343
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34344
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34345
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34353
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34354
+ * a time window was never related to the event the pixels were waiting for.
34355
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34356
+ * at which moment the runner cuts the subject tiles it actually wanted and
34357
+ * releases the frame. The bound exists only so a runner that stops answering
34358
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34359
+ *
34360
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34361
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34362
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34363
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34364
+ * `holdOverflow` on the metrics line is what says you need it.
34346
34365
  */
34347
- ttlMs: number().int().min(250).max(1e4),
34366
+ holdFrames: number().int().min(1).max(64),
34348
34367
  /**
34349
34368
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34350
34369
  *
34351
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34352
- * which one is actually binding before reasoning from that. At the shipped
34353
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34354
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34355
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34356
- * change that admits fewer frames buys retention WINDOW at constant RAM
34357
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34370
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34371
+ * is what decides how much is held, and the ceiling is the number above which
34372
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34373
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34374
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34375
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34358
34376
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34359
34377
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34360
34378
  * to replace).
@@ -34380,22 +34398,45 @@ object({
34380
34398
  * there is the signal that some caller names frames outside the inference set
34381
34399
  * and that this must go back to `all`.
34382
34400
  */
34383
- admission: NativeLeaseAdmissionSchema
34401
+ admission: NativeLeaseAdmissionSchema,
34402
+ /**
34403
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34404
+ * compressed native crops the worker cuts at the moment a frame's detection
34405
+ * result arrives, and keeps long after the frame itself is freed.
34406
+ *
34407
+ * This is the knob that replaced the old retention window, and it buys about
34408
+ * three orders of magnitude more of it: a tile is one subject at native
34409
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34410
+ * the frame it was cut from. A frame on which nothing was detected costs
34411
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34412
+ * was interrogated per SUBJECT.
34413
+ *
34414
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34415
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34416
+ * reproduce that.
34417
+ */
34418
+ tileBudgetMb: number().int().min(0).max(1024)
34384
34419
  });
34385
34420
  /**
34386
- * The values in force when the operator has set nothing — byte-for-byte the
34387
- * constants the decode worker shipped with as env-var defaults, so making these
34388
- * settings changed no behaviour on the day it landed.
34421
+ * The values in force when the operator has set nothing.
34422
+ *
34423
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34424
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34425
+ * in the same change that redefines it would make a regression and a retune
34426
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34427
+ * live traffic.
34389
34428
  */
34390
34429
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34391
- ttlMs: 1200,
34430
+ holdFrames: 8,
34392
34431
  budgetMb: 1024,
34393
34432
  activityMs: 15e3,
34433
+ tileBudgetMb: 64,
34394
34434
  admission: "inferred"
34395
34435
  };
34396
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34436
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34397
34437
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34398
34438
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34439
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34399
34440
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34400
34441
  /**
34401
34442
  * Pure fuzzy matcher for adoption location import. Normalized
@@ -25509,13 +25509,24 @@ method(object({
25509
25509
  /** Playback-speed multiplier for the render (1 = realtime). */
25510
25510
  var ExportSpeedSchema = number().min(.25).max(32);
25511
25511
  /**
25512
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25512
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25513
25513
  *
25514
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25515
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25516
- * playlist. Handing it absolute epochs would make every call site responsible
25517
- * for the same subtraction, and the one that forgot would emit a filter that
25518
- * selects nothing silently, as a uniform timelapse.
25514
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25515
+ * derives these bounds from things that happened at a TIME (a track's
25516
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25517
+ * every segment present for the range, with each recording GAP removed. The
25518
+ * two agree only on a window that recorded without one interruption, and only
25519
+ * the render side knows the segments, so the translation lives there
25520
+ * (`export-dense-map.ts`, addon-pipeline).
25521
+ *
25522
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25523
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25524
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25525
+ * the video was a uniform timelapse, and the log line reported the five ranges
25526
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25527
+ *
25528
+ * Relative and not absolute epoch, because an absolute epoch would make every
25529
+ * call site responsible for the same subtraction.
25519
25530
  */
25520
25531
  var ExportDenseRangeSchema = object({
25521
25532
  fromSec: number().nonnegative(),
@@ -34336,25 +34347,32 @@ object({
34336
34347
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34337
34348
  object({
34338
34349
  /**
34339
- * How long a retained native frame is served before it counts as a miss.
34350
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34351
+ * detection result.
34340
34352
  *
34341
- * Must cover the FULL late-crop horizon: detection inference + the
34342
- * cross-process inference-result hop to hub post-analysis + tracking + the
34343
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34344
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34345
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34353
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34354
+ * a time window was never related to the event the pixels were waiting for.
34355
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34356
+ * at which moment the runner cuts the subject tiles it actually wanted and
34357
+ * releases the frame. The bound exists only so a runner that stops answering
34358
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34359
+ *
34360
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34361
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34362
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34363
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34364
+ * `holdOverflow` on the metrics line is what says you need it.
34346
34365
  */
34347
- ttlMs: number().int().min(250).max(1e4),
34366
+ holdFrames: number().int().min(1).max(64),
34348
34367
  /**
34349
34368
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34350
34369
  *
34351
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34352
- * which one is actually binding before reasoning from that. At the shipped
34353
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34354
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34355
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34356
- * change that admits fewer frames buys retention WINDOW at constant RAM
34357
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34370
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34371
+ * is what decides how much is held, and the ceiling is the number above which
34372
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34373
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34374
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34375
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34358
34376
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34359
34377
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34360
34378
  * to replace).
@@ -34380,22 +34398,45 @@ object({
34380
34398
  * there is the signal that some caller names frames outside the inference set
34381
34399
  * and that this must go back to `all`.
34382
34400
  */
34383
- admission: NativeLeaseAdmissionSchema
34401
+ admission: NativeLeaseAdmissionSchema,
34402
+ /**
34403
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34404
+ * compressed native crops the worker cuts at the moment a frame's detection
34405
+ * result arrives, and keeps long after the frame itself is freed.
34406
+ *
34407
+ * This is the knob that replaced the old retention window, and it buys about
34408
+ * three orders of magnitude more of it: a tile is one subject at native
34409
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34410
+ * the frame it was cut from. A frame on which nothing was detected costs
34411
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34412
+ * was interrogated per SUBJECT.
34413
+ *
34414
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34415
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34416
+ * reproduce that.
34417
+ */
34418
+ tileBudgetMb: number().int().min(0).max(1024)
34384
34419
  });
34385
34420
  /**
34386
- * The values in force when the operator has set nothing — byte-for-byte the
34387
- * constants the decode worker shipped with as env-var defaults, so making these
34388
- * settings changed no behaviour on the day it landed.
34421
+ * The values in force when the operator has set nothing.
34422
+ *
34423
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34424
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34425
+ * in the same change that redefines it would make a regression and a retune
34426
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34427
+ * live traffic.
34389
34428
  */
34390
34429
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34391
- ttlMs: 1200,
34430
+ holdFrames: 8,
34392
34431
  budgetMb: 1024,
34393
34432
  activityMs: 15e3,
34433
+ tileBudgetMb: 64,
34394
34434
  admission: "inferred"
34395
34435
  };
34396
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34436
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34397
34437
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34398
34438
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34439
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34399
34440
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34400
34441
  /**
34401
34442
  * Pure fuzzy matcher for adoption location import. Normalized
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-20wP9knC.js");
6
+ const require_dist = require("../dist-CmlVRSvD.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 { G as oauthIntegrationCapability, O as deviceExportCapability, bt as string, c as addonRoutesCapability, ct as BaseAddon, i as CameraSwitchIdSchema, r as COCO_TO_MACRO, v as buildAddonRouteProvider, wt as EventCategory } from "../dist-CKvJQg2D.mjs";
1
+ import { G as oauthIntegrationCapability, O as deviceExportCapability, bt as string, c as addonRoutesCapability, ct as BaseAddon, i as CameraSwitchIdSchema, r as COCO_TO_MACRO, v as buildAddonRouteProvider, wt as EventCategory } from "../dist-DC4EnKFm.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.25",
3
+ "version": "1.2.26",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",