@camstack/addon-provider-tuya 0.2.75 → 0.2.77

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.
@@ -8774,13 +8771,28 @@ var RecordingBandSchema = object({
8774
8771
  end: string().regex(HHMM),
8775
8772
  mode: RecordingBandModeSchema,
8776
8773
  triggers: RecordingBandTriggersSchema.optional(),
8774
+ /**
8775
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8776
+ *
8777
+ * It was the retroactive KEEP bound — which already-written segments survive
8778
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8779
+ * broker could serve, or the gate would delete the seconds the ring had just
8780
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8781
+ * expression of the broker's retention, in different units, in a different
8782
+ * addon, with an invariant the operator had to maintain by hand. The keep
8783
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8784
+ * left to configure here.
8785
+ *
8786
+ * The key survives in the SHAPE so a config written before that record still
8787
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8788
+ * strict, so simply deleting it would strip an operator's value in silence on
8789
+ * the next save (the failure D380 came one commit from shipping). Nothing
8790
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8791
+ */
8777
8792
  preBufferSec: number().min(0).optional(),
8778
8793
  postBufferSec: number().min(0).optional()
8779
8794
  });
8780
- ({
8781
- preBufferSec: 15,
8782
- postBufferSec: 30
8783
- }).postBufferSec * 1e3;
8795
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8784
8796
  /**
8785
8797
  * Per-device retention overrides. Every field is optional; an unset or `0`
8786
8798
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8828,8 +8840,29 @@ var RecordingConfigSchema = object({
8828
8840
  * "off" is the absence of a covering band, never a band value.
8829
8841
  */
8830
8842
  bands: array(RecordingBandSchema).default([]),
8843
+ /**
8844
+ * THE device-decided intent: record for as long as the camera itself raises
8845
+ * `recording-signal` (`active: true` while the device is in function — a
8846
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8847
+ * recording intent that is not a band.
8848
+ *
8849
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8850
+ * no hour to program: the device decides. What it costs the operator is one
8851
+ * flag — "this camera can record on its own" — and what it buys is the same
8852
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8853
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8854
+ * job however long it is, and closes one pad after the fall.
8855
+ *
8856
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8857
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8858
+ * operator switching this camera off is REPORTED off, never as broken.
8859
+ */
8860
+ deviceDecision: boolean().optional(),
8831
8861
  retention: RecordingRetentionSchema.optional()
8832
- }).strict();
8862
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8863
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8864
+ path: ["bands"]
8865
+ });
8833
8866
  /**
8834
8867
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8835
8868
  *
@@ -21862,11 +21895,7 @@ var CameraAudioStatusSchema = object({
21862
21895
  });
21863
21896
  /** Recording block — null when no recording cap is active for this device. */
21864
21897
  var CameraRecordingStatusSchema = object({
21865
- mode: _enum([
21866
- "off",
21867
- "continuous",
21868
- "events"
21869
- ]),
21898
+ mode: RecordingStorageModeSchema,
21870
21899
  active: boolean(),
21871
21900
  storageBytes: number()
21872
21901
  });
@@ -30128,11 +30157,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30128
30157
  var RecordingStatusSchema = object({
30129
30158
  deviceId: number(),
30130
30159
  enabled: boolean(),
30131
- activeMode: _enum([
30132
- "off",
30133
- "continuous",
30134
- "events"
30135
- ]),
30160
+ /** THE derived storage mode, from the one definition
30161
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30162
+ * `on-device-decision` could have reached the recorder and not the status. */
30163
+ activeMode: RecordingStorageModeSchema,
30136
30164
  nodeId: string(),
30137
30165
  storageBytes: number()
30138
30166
  });
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.
@@ -8773,13 +8770,28 @@ var RecordingBandSchema = object({
8773
8770
  end: string().regex(HHMM),
8774
8771
  mode: RecordingBandModeSchema,
8775
8772
  triggers: RecordingBandTriggersSchema.optional(),
8773
+ /**
8774
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8775
+ *
8776
+ * It was the retroactive KEEP bound — which already-written segments survive
8777
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8778
+ * broker could serve, or the gate would delete the seconds the ring had just
8779
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8780
+ * expression of the broker's retention, in different units, in a different
8781
+ * addon, with an invariant the operator had to maintain by hand. The keep
8782
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8783
+ * left to configure here.
8784
+ *
8785
+ * The key survives in the SHAPE so a config written before that record still
8786
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8787
+ * strict, so simply deleting it would strip an operator's value in silence on
8788
+ * the next save (the failure D380 came one commit from shipping). Nothing
8789
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8790
+ */
8776
8791
  preBufferSec: number().min(0).optional(),
8777
8792
  postBufferSec: number().min(0).optional()
8778
8793
  });
8779
- ({
8780
- preBufferSec: 15,
8781
- postBufferSec: 30
8782
- }).postBufferSec * 1e3;
8794
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8783
8795
  /**
8784
8796
  * Per-device retention overrides. Every field is optional; an unset or `0`
8785
8797
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8827,8 +8839,29 @@ var RecordingConfigSchema = object({
8827
8839
  * "off" is the absence of a covering band, never a band value.
8828
8840
  */
8829
8841
  bands: array(RecordingBandSchema).default([]),
8842
+ /**
8843
+ * THE device-decided intent: record for as long as the camera itself raises
8844
+ * `recording-signal` (`active: true` while the device is in function — a
8845
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8846
+ * recording intent that is not a band.
8847
+ *
8848
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8849
+ * no hour to program: the device decides. What it costs the operator is one
8850
+ * flag — "this camera can record on its own" — and what it buys is the same
8851
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8852
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8853
+ * job however long it is, and closes one pad after the fall.
8854
+ *
8855
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8856
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8857
+ * operator switching this camera off is REPORTED off, never as broken.
8858
+ */
8859
+ deviceDecision: boolean().optional(),
8830
8860
  retention: RecordingRetentionSchema.optional()
8831
- }).strict();
8861
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8862
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8863
+ path: ["bands"]
8864
+ });
8832
8865
  /**
8833
8866
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8834
8867
  *
@@ -21861,11 +21894,7 @@ var CameraAudioStatusSchema = object({
21861
21894
  });
21862
21895
  /** Recording block — null when no recording cap is active for this device. */
21863
21896
  var CameraRecordingStatusSchema = object({
21864
- mode: _enum([
21865
- "off",
21866
- "continuous",
21867
- "events"
21868
- ]),
21897
+ mode: RecordingStorageModeSchema,
21869
21898
  active: boolean(),
21870
21899
  storageBytes: number()
21871
21900
  });
@@ -30127,11 +30156,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30127
30156
  var RecordingStatusSchema = object({
30128
30157
  deviceId: number(),
30129
30158
  enabled: boolean(),
30130
- activeMode: _enum([
30131
- "off",
30132
- "continuous",
30133
- "events"
30134
- ]),
30159
+ /** THE derived storage mode, from the one definition
30160
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30161
+ * `on-device-decision` could have reached the recorder and not the status. */
30162
+ activeMode: RecordingStorageModeSchema,
30135
30163
  nodeId: string(),
30136
30164
  storageBytes: number()
30137
30165
  });
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.77",
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",