@camstack/addon-provider-tuya 0.2.109 → 0.2.111

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
@@ -6180,7 +6180,7 @@ var ZodIssueCode = {
6180
6180
  var ZodFirstPartyTypeKind;
6181
6181
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6182
6182
  //#endregion
6183
- //#region ../types/dist/sleep-BDR76Ykr.mjs
6183
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
6184
6184
  /**
6185
6185
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6186
6186
  * window to float samples (D455).
@@ -31714,14 +31714,81 @@ var privacyMaskCapability = {
31714
31714
  * whether persisting is worth a SQLite commit. */
31715
31715
  volatileStateFields: ["lastFetchedAt"]
31716
31716
  };
31717
+ /**
31718
+ * What a preset id DOES on this camera.
31719
+ *
31720
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31721
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31722
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31723
+ * firmware:
31724
+ *
31725
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31726
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31727
+ * 95 Call OSD menu
31728
+ *
31729
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31730
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31731
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31732
+ * operator as a transport failure.
31733
+ *
31734
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31735
+ * is the single most useful thing that camera can do. Only `savePreset` and
31736
+ * `deletePreset` are gated.
31737
+ */
31738
+ var PtzPresetFunctionSchema = _enum([
31739
+ "home",
31740
+ "day-mode",
31741
+ "night-mode",
31742
+ "day-night-auto",
31743
+ "set-limits",
31744
+ "save-limits",
31745
+ "reboot",
31746
+ "osd-menu"
31747
+ ]);
31717
31748
  var PtzPresetSchema = object({
31718
31749
  id: string(),
31719
- name: string()
31750
+ name: string(),
31751
+ /**
31752
+ * The firmware function this id performs, when the provider KNOWS the id is
31753
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31754
+ * provider does not recognise -- the two are told apart by `writable`.
31755
+ */
31756
+ fn: PtzPresetFunctionSchema.nullable(),
31757
+ /**
31758
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31759
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31760
+ * documented it stays true and a refusal comes from the camera, named.
31761
+ */
31762
+ writable: boolean()
31720
31763
  });
31764
+ /**
31765
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31766
+ * read it.
31767
+ *
31768
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31769
+ * position no way to say so. All four said `0`:
31770
+ *
31771
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31772
+ * path lands upstream"
31773
+ * hikvision stub, "firmware-dependent and frequently absent"
31774
+ * amcrest stub, "no generic absolute-position read for this model family"
31775
+ * onvif throws
31776
+ *
31777
+ * So every consumer asking where a camera points was told "perfectly centred"
31778
+ * by four cameras that had never looked. That is D393 -- a measurement that
31779
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31780
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31781
+ * headroom", which evacuated a healthy disk.
31782
+ *
31783
+ * D393 also says to check for a narrower structural TWIN of the result type.
31784
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31785
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31786
+ * tells callers to migrate to.
31787
+ */
31721
31788
  var PtzPositionSchema = object({
31722
- pan: number(),
31723
- tilt: number(),
31724
- zoom: number()
31789
+ pan: number().nullable(),
31790
+ tilt: number().nullable(),
31791
+ zoom: number().nullable()
31725
31792
  });
31726
31793
  var PtzMoveCommandSchema = object({
31727
31794
  pan: number().optional(),
@@ -31740,7 +31807,72 @@ var PtzOptionsSchema = object({
31740
31807
  maxPresets: number().optional(),
31741
31808
  /** Whether the camera exposes a controllable autofocus toggle
31742
31809
  * (boolean `hasX` per the getOptions availability convention). */
31743
- hasAutofocus: boolean()
31810
+ hasAutofocus: boolean(),
31811
+ /**
31812
+ * How many distinct speeds this camera's NATIVE scale offers.
31813
+ *
31814
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31815
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31816
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31817
+ * meaningless, because it has eight steps and three of them round to the
31818
+ * same one. A loop that tunes its own gain has to know the granularity of
31819
+ * the knob it is turning.
31820
+ *
31821
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31822
+ * a float). Never a made-up number.
31823
+ */
31824
+ speedSteps: number().int().positive().nullable(),
31825
+ /**
31826
+ * How long ONE `move` pulse runs on this driver, ms.
31827
+ *
31828
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31829
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31830
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31831
+ * did the head travel per pulse": without it a measured displacement has no
31832
+ * gain to be divided into.
31833
+ *
31834
+ * `null` = the driver cannot say.
31835
+ */
31836
+ moveImpulseMs: number().int().positive().nullable()
31837
+ });
31838
+ /**
31839
+ * Which preset `goHome` goes to, and WHO decided.
31840
+ *
31841
+ * `goHome` used to be three vendor "conventions" written in three comments --
31842
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31843
+ * not one of the three cameras honours its own:
31844
+ *
31845
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31846
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31847
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31848
+ *
31849
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31850
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31851
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31852
+ * needs an answer that is true per camera and audible when it is missing.
31853
+ *
31854
+ * `source` is what makes it honest:
31855
+ * - `operator` -- picked in the UI, stored by the provider.
31856
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31857
+ * "Back to origin"), adopted as the default with nothing to configure.
31858
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31859
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31860
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31861
+ * no picker.
31862
+ * - `none` -- nothing is configured and the camera names nothing.
31863
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31864
+ *
31865
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31866
+ * native case has no preset and homes perfectly well.
31867
+ */
31868
+ var PtzHomePresetSchema = object({
31869
+ presetId: string().nullable(),
31870
+ source: _enum([
31871
+ "operator",
31872
+ "firmware",
31873
+ "native",
31874
+ "none"
31875
+ ])
31744
31876
  });
31745
31877
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(PtzPresetSchema)), method(object({
31746
31878
  deviceId: number(),
@@ -31758,7 +31890,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31758
31890
  }), _void(), {
31759
31891
  kind: "mutation",
31760
31892
  auth: "admin"
31761
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31893
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31894
+ deviceId: number(),
31895
+ presetId: string().nullable()
31896
+ }), _void(), {
31897
+ kind: "mutation",
31898
+ auth: "admin"
31899
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31762
31900
  deviceId: number(),
31763
31901
  enabled: boolean()
31764
31902
  }), _void(), { kind: "mutation" });
@@ -41012,6 +41150,12 @@ Object.freeze({
41012
41150
  addonId: null,
41013
41151
  access: "delete"
41014
41152
  },
41153
+ "ptz.getHomePreset": {
41154
+ capName: "ptz",
41155
+ capScope: "device",
41156
+ addonId: null,
41157
+ access: "view"
41158
+ },
41015
41159
  "ptz.getOptions": {
41016
41160
  capName: "ptz",
41017
41161
  capScope: "device",
@@ -41060,6 +41204,12 @@ Object.freeze({
41060
41204
  addonId: null,
41061
41205
  access: "create"
41062
41206
  },
41207
+ "ptz.setHomePreset": {
41208
+ capName: "ptz",
41209
+ capScope: "device",
41210
+ addonId: null,
41211
+ access: "create"
41212
+ },
41063
41213
  "ptz.stop": {
41064
41214
  capName: "ptz",
41065
41215
  capScope: "device",
@@ -44233,6 +44383,11 @@ Object.freeze({
44233
44383
  form: "single",
44234
44384
  optional: false
44235
44385
  }],
44386
+ "ptz.getHomePreset": [{
44387
+ name: "deviceId",
44388
+ form: "single",
44389
+ optional: false
44390
+ }],
44236
44391
  "ptz.getOptions": [{
44237
44392
  name: "deviceId",
44238
44393
  form: "single",
@@ -44273,6 +44428,11 @@ Object.freeze({
44273
44428
  form: "single",
44274
44429
  optional: false
44275
44430
  }],
44431
+ "ptz.setHomePreset": [{
44432
+ name: "deviceId",
44433
+ form: "single",
44434
+ optional: false
44435
+ }],
44276
44436
  "ptz.stop": [{
44277
44437
  name: "deviceId",
44278
44438
  form: "single",
package/dist/addon.mjs CHANGED
@@ -6179,7 +6179,7 @@ var ZodIssueCode = {
6179
6179
  var ZodFirstPartyTypeKind;
6180
6180
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6181
6181
  //#endregion
6182
- //#region ../types/dist/sleep-BDR76Ykr.mjs
6182
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
6183
6183
  /**
6184
6184
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6185
6185
  * window to float samples (D455).
@@ -31713,14 +31713,81 @@ var privacyMaskCapability = {
31713
31713
  * whether persisting is worth a SQLite commit. */
31714
31714
  volatileStateFields: ["lastFetchedAt"]
31715
31715
  };
31716
+ /**
31717
+ * What a preset id DOES on this camera.
31718
+ *
31719
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31720
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31721
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31722
+ * firmware:
31723
+ *
31724
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31725
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31726
+ * 95 Call OSD menu
31727
+ *
31728
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31729
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31730
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31731
+ * operator as a transport failure.
31732
+ *
31733
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31734
+ * is the single most useful thing that camera can do. Only `savePreset` and
31735
+ * `deletePreset` are gated.
31736
+ */
31737
+ var PtzPresetFunctionSchema = _enum([
31738
+ "home",
31739
+ "day-mode",
31740
+ "night-mode",
31741
+ "day-night-auto",
31742
+ "set-limits",
31743
+ "save-limits",
31744
+ "reboot",
31745
+ "osd-menu"
31746
+ ]);
31716
31747
  var PtzPresetSchema = object({
31717
31748
  id: string(),
31718
- name: string()
31749
+ name: string(),
31750
+ /**
31751
+ * The firmware function this id performs, when the provider KNOWS the id is
31752
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31753
+ * provider does not recognise -- the two are told apart by `writable`.
31754
+ */
31755
+ fn: PtzPresetFunctionSchema.nullable(),
31756
+ /**
31757
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31758
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31759
+ * documented it stays true and a refusal comes from the camera, named.
31760
+ */
31761
+ writable: boolean()
31719
31762
  });
31763
+ /**
31764
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31765
+ * read it.
31766
+ *
31767
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31768
+ * position no way to say so. All four said `0`:
31769
+ *
31770
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31771
+ * path lands upstream"
31772
+ * hikvision stub, "firmware-dependent and frequently absent"
31773
+ * amcrest stub, "no generic absolute-position read for this model family"
31774
+ * onvif throws
31775
+ *
31776
+ * So every consumer asking where a camera points was told "perfectly centred"
31777
+ * by four cameras that had never looked. That is D393 -- a measurement that
31778
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31779
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31780
+ * headroom", which evacuated a healthy disk.
31781
+ *
31782
+ * D393 also says to check for a narrower structural TWIN of the result type.
31783
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31784
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31785
+ * tells callers to migrate to.
31786
+ */
31720
31787
  var PtzPositionSchema = object({
31721
- pan: number(),
31722
- tilt: number(),
31723
- zoom: number()
31788
+ pan: number().nullable(),
31789
+ tilt: number().nullable(),
31790
+ zoom: number().nullable()
31724
31791
  });
31725
31792
  var PtzMoveCommandSchema = object({
31726
31793
  pan: number().optional(),
@@ -31739,7 +31806,72 @@ var PtzOptionsSchema = object({
31739
31806
  maxPresets: number().optional(),
31740
31807
  /** Whether the camera exposes a controllable autofocus toggle
31741
31808
  * (boolean `hasX` per the getOptions availability convention). */
31742
- hasAutofocus: boolean()
31809
+ hasAutofocus: boolean(),
31810
+ /**
31811
+ * How many distinct speeds this camera's NATIVE scale offers.
31812
+ *
31813
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31814
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31815
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31816
+ * meaningless, because it has eight steps and three of them round to the
31817
+ * same one. A loop that tunes its own gain has to know the granularity of
31818
+ * the knob it is turning.
31819
+ *
31820
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31821
+ * a float). Never a made-up number.
31822
+ */
31823
+ speedSteps: number().int().positive().nullable(),
31824
+ /**
31825
+ * How long ONE `move` pulse runs on this driver, ms.
31826
+ *
31827
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31828
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31829
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31830
+ * did the head travel per pulse": without it a measured displacement has no
31831
+ * gain to be divided into.
31832
+ *
31833
+ * `null` = the driver cannot say.
31834
+ */
31835
+ moveImpulseMs: number().int().positive().nullable()
31836
+ });
31837
+ /**
31838
+ * Which preset `goHome` goes to, and WHO decided.
31839
+ *
31840
+ * `goHome` used to be three vendor "conventions" written in three comments --
31841
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31842
+ * not one of the three cameras honours its own:
31843
+ *
31844
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31845
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31846
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31847
+ *
31848
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31849
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31850
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31851
+ * needs an answer that is true per camera and audible when it is missing.
31852
+ *
31853
+ * `source` is what makes it honest:
31854
+ * - `operator` -- picked in the UI, stored by the provider.
31855
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31856
+ * "Back to origin"), adopted as the default with nothing to configure.
31857
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31858
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31859
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31860
+ * no picker.
31861
+ * - `none` -- nothing is configured and the camera names nothing.
31862
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31863
+ *
31864
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31865
+ * native case has no preset and homes perfectly well.
31866
+ */
31867
+ var PtzHomePresetSchema = object({
31868
+ presetId: string().nullable(),
31869
+ source: _enum([
31870
+ "operator",
31871
+ "firmware",
31872
+ "native",
31873
+ "none"
31874
+ ])
31743
31875
  });
31744
31876
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(PtzPresetSchema)), method(object({
31745
31877
  deviceId: number(),
@@ -31757,7 +31889,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31757
31889
  }), _void(), {
31758
31890
  kind: "mutation",
31759
31891
  auth: "admin"
31760
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31892
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31893
+ deviceId: number(),
31894
+ presetId: string().nullable()
31895
+ }), _void(), {
31896
+ kind: "mutation",
31897
+ auth: "admin"
31898
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31761
31899
  deviceId: number(),
31762
31900
  enabled: boolean()
31763
31901
  }), _void(), { kind: "mutation" });
@@ -41011,6 +41149,12 @@ Object.freeze({
41011
41149
  addonId: null,
41012
41150
  access: "delete"
41013
41151
  },
41152
+ "ptz.getHomePreset": {
41153
+ capName: "ptz",
41154
+ capScope: "device",
41155
+ addonId: null,
41156
+ access: "view"
41157
+ },
41014
41158
  "ptz.getOptions": {
41015
41159
  capName: "ptz",
41016
41160
  capScope: "device",
@@ -41059,6 +41203,12 @@ Object.freeze({
41059
41203
  addonId: null,
41060
41204
  access: "create"
41061
41205
  },
41206
+ "ptz.setHomePreset": {
41207
+ capName: "ptz",
41208
+ capScope: "device",
41209
+ addonId: null,
41210
+ access: "create"
41211
+ },
41062
41212
  "ptz.stop": {
41063
41213
  capName: "ptz",
41064
41214
  capScope: "device",
@@ -44232,6 +44382,11 @@ Object.freeze({
44232
44382
  form: "single",
44233
44383
  optional: false
44234
44384
  }],
44385
+ "ptz.getHomePreset": [{
44386
+ name: "deviceId",
44387
+ form: "single",
44388
+ optional: false
44389
+ }],
44235
44390
  "ptz.getOptions": [{
44236
44391
  name: "deviceId",
44237
44392
  form: "single",
@@ -44272,6 +44427,11 @@ Object.freeze({
44272
44427
  form: "single",
44273
44428
  optional: false
44274
44429
  }],
44430
+ "ptz.setHomePreset": [{
44431
+ name: "deviceId",
44432
+ form: "single",
44433
+ optional: false
44434
+ }],
44275
44435
  "ptz.stop": [{
44276
44436
  name: "deviceId",
44277
44437
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.109",
3
+ "version": "0.2.111",
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",