@camstack/addon-provider-tuya 0.2.75 → 0.2.76

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
@@ -8669,17 +8669,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8669
8669
  /**
8670
8670
  * DERIVED per-camera storage summary — the single field cheap consumers read
8671
8671
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8672
- * - `off` — no band covers the camera (or it is disabled).
8673
- * - `events` — every band records around triggers only.
8674
- * - `continuous` — at least one band records continuously.
8675
- *
8676
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8677
- * every save (`activeModeForConfig`). Writing it has no effect.
8672
+ * - `off` — no band covers the camera (or it is disabled).
8673
+ * - `events` — every band records around triggers only.
8674
+ * - `continuous` — at least one band records continuously.
8675
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8676
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8677
+ * is no schedule to author, because there is no hour to program — see
8678
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8679
+ *
8680
+ * NEVER authored: the recorder stamps it from the authoritative intent
8681
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8682
+ * has no effect.
8683
+ *
8684
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8685
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8686
+ * something the operator makes (the live gate is the recorder's own "demand
8687
+ * window"), and a knob whose name suggests the operator starts it while the
8688
+ * device actually does is the D62 shape — a control nobody can predict.
8678
8689
  */
8679
8690
  var RecordingStorageModeSchema = _enum([
8680
8691
  "off",
8681
8692
  "events",
8682
- "continuous"
8693
+ "continuous",
8694
+ "on-device-decision"
8683
8695
  ]);
8684
8696
  /**
8685
8697
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8729,22 +8741,7 @@ var RecordingTriggersSchema = object({
8729
8741
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8730
8742
  * registrare.
8731
8743
  */
8732
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8733
- /**
8734
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8735
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8736
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8737
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8738
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8739
- *
8740
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8741
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8742
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8743
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8744
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8745
- * (`holdTrigger` / `releaseTrigger`).
8746
- */
8747
- deviceSignal: boolean().optional()
8744
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8748
8745
  });
8749
8746
  /**
8750
8747
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8828,8 +8825,29 @@ var RecordingConfigSchema = object({
8828
8825
  * "off" is the absence of a covering band, never a band value.
8829
8826
  */
8830
8827
  bands: array(RecordingBandSchema).default([]),
8828
+ /**
8829
+ * THE device-decided intent: record for as long as the camera itself raises
8830
+ * `recording-signal` (`active: true` while the device is in function — a
8831
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8832
+ * recording intent that is not a band.
8833
+ *
8834
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8835
+ * no hour to program: the device decides. What it costs the operator is one
8836
+ * flag — "this camera can record on its own" — and what it buys is the same
8837
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8838
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8839
+ * job however long it is, and closes one pad after the fall.
8840
+ *
8841
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8842
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8843
+ * operator switching this camera off is REPORTED off, never as broken.
8844
+ */
8845
+ deviceDecision: boolean().optional(),
8831
8846
  retention: RecordingRetentionSchema.optional()
8832
- }).strict();
8847
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8848
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8849
+ path: ["bands"]
8850
+ });
8833
8851
  /**
8834
8852
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8835
8853
  *
@@ -21862,11 +21880,7 @@ var CameraAudioStatusSchema = object({
21862
21880
  });
21863
21881
  /** Recording block — null when no recording cap is active for this device. */
21864
21882
  var CameraRecordingStatusSchema = object({
21865
- mode: _enum([
21866
- "off",
21867
- "continuous",
21868
- "events"
21869
- ]),
21883
+ mode: RecordingStorageModeSchema,
21870
21884
  active: boolean(),
21871
21885
  storageBytes: number()
21872
21886
  });
@@ -30128,11 +30142,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30128
30142
  var RecordingStatusSchema = object({
30129
30143
  deviceId: number(),
30130
30144
  enabled: boolean(),
30131
- activeMode: _enum([
30132
- "off",
30133
- "continuous",
30134
- "events"
30135
- ]),
30145
+ /** THE derived storage mode, from the one definition
30146
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30147
+ * `on-device-decision` could have reached the recorder and not the status. */
30148
+ activeMode: RecordingStorageModeSchema,
30136
30149
  nodeId: string(),
30137
30150
  storageBytes: number()
30138
30151
  });
package/dist/addon.mjs CHANGED
@@ -8668,17 +8668,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8668
8668
  /**
8669
8669
  * DERIVED per-camera storage summary — the single field cheap consumers read
8670
8670
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8671
- * - `off` — no band covers the camera (or it is disabled).
8672
- * - `events` — every band records around triggers only.
8673
- * - `continuous` — at least one band records continuously.
8674
- *
8675
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8676
- * every save (`activeModeForConfig`). Writing it has no effect.
8671
+ * - `off` — no band covers the camera (or it is disabled).
8672
+ * - `events` — every band records around triggers only.
8673
+ * - `continuous` — at least one band records continuously.
8674
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8675
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8676
+ * is no schedule to author, because there is no hour to program — see
8677
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8678
+ *
8679
+ * NEVER authored: the recorder stamps it from the authoritative intent
8680
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8681
+ * has no effect.
8682
+ *
8683
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8684
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8685
+ * something the operator makes (the live gate is the recorder's own "demand
8686
+ * window"), and a knob whose name suggests the operator starts it while the
8687
+ * device actually does is the D62 shape — a control nobody can predict.
8677
8688
  */
8678
8689
  var RecordingStorageModeSchema = _enum([
8679
8690
  "off",
8680
8691
  "events",
8681
- "continuous"
8692
+ "continuous",
8693
+ "on-device-decision"
8682
8694
  ]);
8683
8695
  /**
8684
8696
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8728,22 +8740,7 @@ var RecordingTriggersSchema = object({
8728
8740
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8729
8741
  * registrare.
8730
8742
  */
8731
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8732
- /**
8733
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8734
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8735
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8736
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8737
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8738
- *
8739
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8740
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8741
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8742
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8743
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8744
- * (`holdTrigger` / `releaseTrigger`).
8745
- */
8746
- deviceSignal: boolean().optional()
8743
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8747
8744
  });
8748
8745
  /**
8749
8746
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8827,8 +8824,29 @@ var RecordingConfigSchema = object({
8827
8824
  * "off" is the absence of a covering band, never a band value.
8828
8825
  */
8829
8826
  bands: array(RecordingBandSchema).default([]),
8827
+ /**
8828
+ * THE device-decided intent: record for as long as the camera itself raises
8829
+ * `recording-signal` (`active: true` while the device is in function — a
8830
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8831
+ * recording intent that is not a band.
8832
+ *
8833
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8834
+ * no hour to program: the device decides. What it costs the operator is one
8835
+ * flag — "this camera can record on its own" — and what it buys is the same
8836
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8837
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8838
+ * job however long it is, and closes one pad after the fall.
8839
+ *
8840
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8841
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8842
+ * operator switching this camera off is REPORTED off, never as broken.
8843
+ */
8844
+ deviceDecision: boolean().optional(),
8830
8845
  retention: RecordingRetentionSchema.optional()
8831
- }).strict();
8846
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8847
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8848
+ path: ["bands"]
8849
+ });
8832
8850
  /**
8833
8851
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8834
8852
  *
@@ -21861,11 +21879,7 @@ var CameraAudioStatusSchema = object({
21861
21879
  });
21862
21880
  /** Recording block — null when no recording cap is active for this device. */
21863
21881
  var CameraRecordingStatusSchema = object({
21864
- mode: _enum([
21865
- "off",
21866
- "continuous",
21867
- "events"
21868
- ]),
21882
+ mode: RecordingStorageModeSchema,
21869
21883
  active: boolean(),
21870
21884
  storageBytes: number()
21871
21885
  });
@@ -30127,11 +30141,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30127
30141
  var RecordingStatusSchema = object({
30128
30142
  deviceId: number(),
30129
30143
  enabled: boolean(),
30130
- activeMode: _enum([
30131
- "off",
30132
- "continuous",
30133
- "events"
30134
- ]),
30144
+ /** THE derived storage mode, from the one definition
30145
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30146
+ * `on-device-decision` could have reached the recorder and not the status. */
30147
+ activeMode: RecordingStorageModeSchema,
30135
30148
  nodeId: string(),
30136
30149
  storageBytes: number()
30137
30150
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.75",
3
+ "version": "0.2.76",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",