@camstack/addon-provider-homeassistant 1.2.91 → 1.2.92

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-BMe3yNz7.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-CDclcQZB.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.
@@ -8211,8 +8208,29 @@ var RecordingConfigSchema = object({
8211
8208
  * "off" is the absence of a covering band, never a band value.
8212
8209
  */
8213
8210
  bands: array(RecordingBandSchema).default([]),
8211
+ /**
8212
+ * THE device-decided intent: record for as long as the camera itself raises
8213
+ * `recording-signal` (`active: true` while the device is in function — a
8214
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8215
+ * recording intent that is not a band.
8216
+ *
8217
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8218
+ * no hour to program: the device decides. What it costs the operator is one
8219
+ * flag — "this camera can record on its own" — and what it buys is the same
8220
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8221
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8222
+ * job however long it is, and closes one pad after the fall.
8223
+ *
8224
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8225
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8226
+ * operator switching this camera off is REPORTED off, never as broken.
8227
+ */
8228
+ deviceDecision: boolean().optional(),
8214
8229
  retention: RecordingRetentionSchema.optional()
8215
- }).strict();
8230
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8231
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8232
+ path: ["bands"]
8233
+ });
8216
8234
  /**
8217
8235
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8218
8236
  *
@@ -21413,11 +21431,7 @@ var CameraAudioStatusSchema = object({
21413
21431
  });
21414
21432
  /** Recording block — null when no recording cap is active for this device. */
21415
21433
  var CameraRecordingStatusSchema = object({
21416
- mode: _enum([
21417
- "off",
21418
- "continuous",
21419
- "events"
21420
- ]),
21434
+ mode: RecordingStorageModeSchema,
21421
21435
  active: boolean(),
21422
21436
  storageBytes: number()
21423
21437
  });
@@ -29760,11 +29774,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29760
29774
  var RecordingStatusSchema = object({
29761
29775
  deviceId: number(),
29762
29776
  enabled: boolean(),
29763
- activeMode: _enum([
29764
- "off",
29765
- "continuous",
29766
- "events"
29767
- ]),
29777
+ /** THE derived storage mode, from the one definition
29778
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29779
+ * `on-device-decision` could have reached the recorder and not the status. */
29780
+ activeMode: RecordingStorageModeSchema,
29768
29781
  nodeId: string(),
29769
29782
  storageBytes: number()
29770
29783
  });
@@ -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.
@@ -8211,8 +8208,29 @@ var RecordingConfigSchema = object({
8211
8208
  * "off" is the absence of a covering band, never a band value.
8212
8209
  */
8213
8210
  bands: array(RecordingBandSchema).default([]),
8211
+ /**
8212
+ * THE device-decided intent: record for as long as the camera itself raises
8213
+ * `recording-signal` (`active: true` while the device is in function — a
8214
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8215
+ * recording intent that is not a band.
8216
+ *
8217
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8218
+ * no hour to program: the device decides. What it costs the operator is one
8219
+ * flag — "this camera can record on its own" — and what it buys is the same
8220
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8221
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8222
+ * job however long it is, and closes one pad after the fall.
8223
+ *
8224
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8225
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8226
+ * operator switching this camera off is REPORTED off, never as broken.
8227
+ */
8228
+ deviceDecision: boolean().optional(),
8214
8229
  retention: RecordingRetentionSchema.optional()
8215
- }).strict();
8230
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8231
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8232
+ path: ["bands"]
8233
+ });
8216
8234
  /**
8217
8235
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8218
8236
  *
@@ -21413,11 +21431,7 @@ var CameraAudioStatusSchema = object({
21413
21431
  });
21414
21432
  /** Recording block — null when no recording cap is active for this device. */
21415
21433
  var CameraRecordingStatusSchema = object({
21416
- mode: _enum([
21417
- "off",
21418
- "continuous",
21419
- "events"
21420
- ]),
21434
+ mode: RecordingStorageModeSchema,
21421
21435
  active: boolean(),
21422
21436
  storageBytes: number()
21423
21437
  });
@@ -29760,11 +29774,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29760
29774
  var RecordingStatusSchema = object({
29761
29775
  deviceId: number(),
29762
29776
  enabled: boolean(),
29763
- activeMode: _enum([
29764
- "off",
29765
- "continuous",
29766
- "events"
29767
- ]),
29777
+ /** THE derived storage mode, from the one definition
29778
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29779
+ * `on-device-decision` could have reached the recorder and not the status. */
29780
+ activeMode: RecordingStorageModeSchema,
29768
29781
  nodeId: string(),
29769
29782
  storageBytes: number()
29770
29783
  });
@@ -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-BMe3yNz7.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-CDclcQZB.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.92",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",