@camstack/addon-provider-homeassistant 1.2.91 → 1.2.93

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-DfCgRCeO.js");
2
+ const require_dist = require("./dist-14FaSOPJ.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-DKXax7Rq.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-5-dwtcpP.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
@@ -8052,17 +8052,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8052
8052
  /**
8053
8053
  * DERIVED per-camera storage summary — the single field cheap consumers read
8054
8054
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8055
- * - `off` — no band covers the camera (or it is disabled).
8056
- * - `events` — every band records around triggers only.
8057
- * - `continuous` — at least one band records continuously.
8058
- *
8059
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8060
- * every save (`activeModeForConfig`). Writing it has no effect.
8055
+ * - `off` — no band covers the camera (or it is disabled).
8056
+ * - `events` — every band records around triggers only.
8057
+ * - `continuous` — at least one band records continuously.
8058
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8059
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8060
+ * is no schedule to author, because there is no hour to program — see
8061
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8062
+ *
8063
+ * NEVER authored: the recorder stamps it from the authoritative intent
8064
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8065
+ * has no effect.
8066
+ *
8067
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8068
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8069
+ * something the operator makes (the live gate is the recorder's own "demand
8070
+ * window"), and a knob whose name suggests the operator starts it while the
8071
+ * device actually does is the D62 shape — a control nobody can predict.
8061
8072
  */
8062
8073
  var RecordingStorageModeSchema = _enum([
8063
8074
  "off",
8064
8075
  "events",
8065
- "continuous"
8076
+ "continuous",
8077
+ "on-device-decision"
8066
8078
  ]);
8067
8079
  /**
8068
8080
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8112,22 +8124,7 @@ var RecordingTriggersSchema = object({
8112
8124
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8113
8125
  * registrare.
8114
8126
  */
8115
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8116
- /**
8117
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8118
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8119
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8120
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8121
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8122
- *
8123
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8124
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8125
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8126
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8127
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8128
- * (`holdTrigger` / `releaseTrigger`).
8129
- */
8130
- deviceSignal: boolean().optional()
8127
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8131
8128
  });
8132
8129
  /**
8133
8130
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8157,13 +8154,28 @@ var RecordingBandSchema = object({
8157
8154
  end: string().regex(HHMM),
8158
8155
  mode: RecordingBandModeSchema,
8159
8156
  triggers: RecordingBandTriggersSchema.optional(),
8157
+ /**
8158
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8159
+ *
8160
+ * It was the retroactive KEEP bound — which already-written segments survive
8161
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8162
+ * broker could serve, or the gate would delete the seconds the ring had just
8163
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8164
+ * expression of the broker's retention, in different units, in a different
8165
+ * addon, with an invariant the operator had to maintain by hand. The keep
8166
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8167
+ * left to configure here.
8168
+ *
8169
+ * The key survives in the SHAPE so a config written before that record still
8170
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8171
+ * strict, so simply deleting it would strip an operator's value in silence on
8172
+ * the next save (the failure D380 came one commit from shipping). Nothing
8173
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8174
+ */
8160
8175
  preBufferSec: number().min(0).optional(),
8161
8176
  postBufferSec: number().min(0).optional()
8162
8177
  });
8163
- ({
8164
- preBufferSec: 15,
8165
- postBufferSec: 30
8166
- }).postBufferSec * 1e3;
8178
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8167
8179
  /**
8168
8180
  * Per-device retention overrides. Every field is optional; an unset or `0`
8169
8181
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8211,8 +8223,29 @@ var RecordingConfigSchema = object({
8211
8223
  * "off" is the absence of a covering band, never a band value.
8212
8224
  */
8213
8225
  bands: array(RecordingBandSchema).default([]),
8226
+ /**
8227
+ * THE device-decided intent: record for as long as the camera itself raises
8228
+ * `recording-signal` (`active: true` while the device is in function — a
8229
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8230
+ * recording intent that is not a band.
8231
+ *
8232
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8233
+ * no hour to program: the device decides. What it costs the operator is one
8234
+ * flag — "this camera can record on its own" — and what it buys is the same
8235
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8236
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8237
+ * job however long it is, and closes one pad after the fall.
8238
+ *
8239
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8240
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8241
+ * operator switching this camera off is REPORTED off, never as broken.
8242
+ */
8243
+ deviceDecision: boolean().optional(),
8214
8244
  retention: RecordingRetentionSchema.optional()
8215
- }).strict();
8245
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8246
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8247
+ path: ["bands"]
8248
+ });
8216
8249
  /**
8217
8250
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8218
8251
  *
@@ -21413,11 +21446,7 @@ var CameraAudioStatusSchema = object({
21413
21446
  });
21414
21447
  /** Recording block — null when no recording cap is active for this device. */
21415
21448
  var CameraRecordingStatusSchema = object({
21416
- mode: _enum([
21417
- "off",
21418
- "continuous",
21419
- "events"
21420
- ]),
21449
+ mode: RecordingStorageModeSchema,
21421
21450
  active: boolean(),
21422
21451
  storageBytes: number()
21423
21452
  });
@@ -29760,11 +29789,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29760
29789
  var RecordingStatusSchema = object({
29761
29790
  deviceId: number(),
29762
29791
  enabled: boolean(),
29763
- activeMode: _enum([
29764
- "off",
29765
- "continuous",
29766
- "events"
29767
- ]),
29792
+ /** THE derived storage mode, from the one definition
29793
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29794
+ * `on-device-decision` could have reached the recorder and not the status. */
29795
+ activeMode: RecordingStorageModeSchema,
29768
29796
  nodeId: string(),
29769
29797
  storageBytes: number()
29770
29798
  });
@@ -8052,17 +8052,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8052
8052
  /**
8053
8053
  * DERIVED per-camera storage summary — the single field cheap consumers read
8054
8054
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8055
- * - `off` — no band covers the camera (or it is disabled).
8056
- * - `events` — every band records around triggers only.
8057
- * - `continuous` — at least one band records continuously.
8058
- *
8059
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8060
- * every save (`activeModeForConfig`). Writing it has no effect.
8055
+ * - `off` — no band covers the camera (or it is disabled).
8056
+ * - `events` — every band records around triggers only.
8057
+ * - `continuous` — at least one band records continuously.
8058
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8059
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8060
+ * is no schedule to author, because there is no hour to program — see
8061
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8062
+ *
8063
+ * NEVER authored: the recorder stamps it from the authoritative intent
8064
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8065
+ * has no effect.
8066
+ *
8067
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8068
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8069
+ * something the operator makes (the live gate is the recorder's own "demand
8070
+ * window"), and a knob whose name suggests the operator starts it while the
8071
+ * device actually does is the D62 shape — a control nobody can predict.
8061
8072
  */
8062
8073
  var RecordingStorageModeSchema = _enum([
8063
8074
  "off",
8064
8075
  "events",
8065
- "continuous"
8076
+ "continuous",
8077
+ "on-device-decision"
8066
8078
  ]);
8067
8079
  /**
8068
8080
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8112,22 +8124,7 @@ var RecordingTriggersSchema = object({
8112
8124
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8113
8125
  * registrare.
8114
8126
  */
8115
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8116
- /**
8117
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8118
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8119
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8120
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8121
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8122
- *
8123
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8124
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8125
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8126
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8127
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8128
- * (`holdTrigger` / `releaseTrigger`).
8129
- */
8130
- deviceSignal: boolean().optional()
8127
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8131
8128
  });
8132
8129
  /**
8133
8130
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8157,13 +8154,28 @@ var RecordingBandSchema = object({
8157
8154
  end: string().regex(HHMM),
8158
8155
  mode: RecordingBandModeSchema,
8159
8156
  triggers: RecordingBandTriggersSchema.optional(),
8157
+ /**
8158
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8159
+ *
8160
+ * It was the retroactive KEEP bound — which already-written segments survive
8161
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8162
+ * broker could serve, or the gate would delete the seconds the ring had just
8163
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8164
+ * expression of the broker's retention, in different units, in a different
8165
+ * addon, with an invariant the operator had to maintain by hand. The keep
8166
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8167
+ * left to configure here.
8168
+ *
8169
+ * The key survives in the SHAPE so a config written before that record still
8170
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8171
+ * strict, so simply deleting it would strip an operator's value in silence on
8172
+ * the next save (the failure D380 came one commit from shipping). Nothing
8173
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8174
+ */
8160
8175
  preBufferSec: number().min(0).optional(),
8161
8176
  postBufferSec: number().min(0).optional()
8162
8177
  });
8163
- ({
8164
- preBufferSec: 15,
8165
- postBufferSec: 30
8166
- }).postBufferSec * 1e3;
8178
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8167
8179
  /**
8168
8180
  * Per-device retention overrides. Every field is optional; an unset or `0`
8169
8181
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8211,8 +8223,29 @@ var RecordingConfigSchema = object({
8211
8223
  * "off" is the absence of a covering band, never a band value.
8212
8224
  */
8213
8225
  bands: array(RecordingBandSchema).default([]),
8226
+ /**
8227
+ * THE device-decided intent: record for as long as the camera itself raises
8228
+ * `recording-signal` (`active: true` while the device is in function — a
8229
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8230
+ * recording intent that is not a band.
8231
+ *
8232
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8233
+ * no hour to program: the device decides. What it costs the operator is one
8234
+ * flag — "this camera can record on its own" — and what it buys is the same
8235
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8236
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8237
+ * job however long it is, and closes one pad after the fall.
8238
+ *
8239
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8240
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8241
+ * operator switching this camera off is REPORTED off, never as broken.
8242
+ */
8243
+ deviceDecision: boolean().optional(),
8214
8244
  retention: RecordingRetentionSchema.optional()
8215
- }).strict();
8245
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8246
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8247
+ path: ["bands"]
8248
+ });
8216
8249
  /**
8217
8250
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8218
8251
  *
@@ -21413,11 +21446,7 @@ var CameraAudioStatusSchema = object({
21413
21446
  });
21414
21447
  /** Recording block — null when no recording cap is active for this device. */
21415
21448
  var CameraRecordingStatusSchema = object({
21416
- mode: _enum([
21417
- "off",
21418
- "continuous",
21419
- "events"
21420
- ]),
21449
+ mode: RecordingStorageModeSchema,
21421
21450
  active: boolean(),
21422
21451
  storageBytes: number()
21423
21452
  });
@@ -29760,11 +29789,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29760
29789
  var RecordingStatusSchema = object({
29761
29790
  deviceId: number(),
29762
29791
  enabled: boolean(),
29763
- activeMode: _enum([
29764
- "off",
29765
- "continuous",
29766
- "events"
29767
- ]),
29792
+ /** THE derived storage mode, from the one definition
29793
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29794
+ * `on-device-decision` could have reached the recorder and not the status. */
29795
+ activeMode: RecordingStorageModeSchema,
29768
29796
  nodeId: string(),
29769
29797
  storageBytes: number()
29770
29798
  });
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-DfCgRCeO.js");
6
+ const require_dist = require("../dist-14FaSOPJ.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 { 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-DKXax7Rq.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-5-dwtcpP.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.91",
3
+ "version": "1.2.93",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",