@camstack/addon-provider-velux 0.2.110 → 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
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
5360
5360
  var ZodFirstPartyTypeKind;
5361
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5362
5362
  //#endregion
5363
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5363
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5364
5364
  /**
5365
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5366
5366
  * window to float samples (D455).
@@ -30869,14 +30869,81 @@ var privacyMaskCapability = {
30869
30869
  * whether persisting is worth a SQLite commit. */
30870
30870
  volatileStateFields: ["lastFetchedAt"]
30871
30871
  };
30872
+ /**
30873
+ * What a preset id DOES on this camera.
30874
+ *
30875
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30876
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30877
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30878
+ * firmware:
30879
+ *
30880
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30881
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30882
+ * 95 Call OSD menu
30883
+ *
30884
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30885
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30886
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30887
+ * operator as a transport failure.
30888
+ *
30889
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30890
+ * is the single most useful thing that camera can do. Only `savePreset` and
30891
+ * `deletePreset` are gated.
30892
+ */
30893
+ var PtzPresetFunctionSchema = _enum([
30894
+ "home",
30895
+ "day-mode",
30896
+ "night-mode",
30897
+ "day-night-auto",
30898
+ "set-limits",
30899
+ "save-limits",
30900
+ "reboot",
30901
+ "osd-menu"
30902
+ ]);
30872
30903
  var PtzPresetSchema = object({
30873
30904
  id: string(),
30874
- name: string()
30905
+ name: string(),
30906
+ /**
30907
+ * The firmware function this id performs, when the provider KNOWS the id is
30908
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
30909
+ * provider does not recognise -- the two are told apart by `writable`.
30910
+ */
30911
+ fn: PtzPresetFunctionSchema.nullable(),
30912
+ /**
30913
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
30914
+ * it false only for a band it KNOWS is reserved; where the firmware is not
30915
+ * documented it stays true and a refusal comes from the camera, named.
30916
+ */
30917
+ writable: boolean()
30875
30918
  });
30919
+ /**
30920
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
30921
+ * read it.
30922
+ *
30923
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
30924
+ * position no way to say so. All four said `0`:
30925
+ *
30926
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
30927
+ * path lands upstream"
30928
+ * hikvision stub, "firmware-dependent and frequently absent"
30929
+ * amcrest stub, "no generic absolute-position read for this model family"
30930
+ * onvif throws
30931
+ *
30932
+ * So every consumer asking where a camera points was told "perfectly centred"
30933
+ * by four cameras that had never looked. That is D393 -- a measurement that
30934
+ * FAILED is `null`, never `0`, and the type says so all the way to the
30935
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
30936
+ * headroom", which evacuated a healthy disk.
30937
+ *
30938
+ * D393 also says to check for a narrower structural TWIN of the result type.
30939
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
30940
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
30941
+ * tells callers to migrate to.
30942
+ */
30876
30943
  var PtzPositionSchema = object({
30877
- pan: number(),
30878
- tilt: number(),
30879
- zoom: number()
30944
+ pan: number().nullable(),
30945
+ tilt: number().nullable(),
30946
+ zoom: number().nullable()
30880
30947
  });
30881
30948
  var PtzMoveCommandSchema = object({
30882
30949
  pan: number().optional(),
@@ -30895,7 +30962,72 @@ var PtzOptionsSchema = object({
30895
30962
  maxPresets: number().optional(),
30896
30963
  /** Whether the camera exposes a controllable autofocus toggle
30897
30964
  * (boolean `hasX` per the getOptions availability convention). */
30898
- hasAutofocus: boolean()
30965
+ hasAutofocus: boolean(),
30966
+ /**
30967
+ * How many distinct speeds this camera's NATIVE scale offers.
30968
+ *
30969
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
30970
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
30971
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
30972
+ * meaningless, because it has eight steps and three of them round to the
30973
+ * same one. A loop that tunes its own gain has to know the granularity of
30974
+ * the knob it is turning.
30975
+ *
30976
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
30977
+ * a float). Never a made-up number.
30978
+ */
30979
+ speedSteps: number().int().positive().nullable(),
30980
+ /**
30981
+ * How long ONE `move` pulse runs on this driver, ms.
30982
+ *
30983
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
30984
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
30985
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
30986
+ * did the head travel per pulse": without it a measured displacement has no
30987
+ * gain to be divided into.
30988
+ *
30989
+ * `null` = the driver cannot say.
30990
+ */
30991
+ moveImpulseMs: number().int().positive().nullable()
30992
+ });
30993
+ /**
30994
+ * Which preset `goHome` goes to, and WHO decided.
30995
+ *
30996
+ * `goHome` used to be three vendor "conventions" written in three comments --
30997
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
30998
+ * not one of the three cameras honours its own:
30999
+ *
31000
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31001
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31002
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31003
+ *
31004
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31005
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31006
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31007
+ * needs an answer that is true per camera and audible when it is missing.
31008
+ *
31009
+ * `source` is what makes it honest:
31010
+ * - `operator` -- picked in the UI, stored by the provider.
31011
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31012
+ * "Back to origin"), adopted as the default with nothing to configure.
31013
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31014
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31015
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31016
+ * no picker.
31017
+ * - `none` -- nothing is configured and the camera names nothing.
31018
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31019
+ *
31020
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31021
+ * native case has no preset and homes perfectly well.
31022
+ */
31023
+ var PtzHomePresetSchema = object({
31024
+ presetId: string().nullable(),
31025
+ source: _enum([
31026
+ "operator",
31027
+ "firmware",
31028
+ "native",
31029
+ "none"
31030
+ ])
30899
31031
  });
30900
31032
  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({
30901
31033
  deviceId: number(),
@@ -30913,7 +31045,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
30913
31045
  }), _void(), {
30914
31046
  kind: "mutation",
30915
31047
  auth: "admin"
30916
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31048
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31049
+ deviceId: number(),
31050
+ presetId: string().nullable()
31051
+ }), _void(), {
31052
+ kind: "mutation",
31053
+ auth: "admin"
31054
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
30917
31055
  deviceId: number(),
30918
31056
  enabled: boolean()
30919
31057
  }), _void(), { kind: "mutation" });
@@ -40167,6 +40305,12 @@ Object.freeze({
40167
40305
  addonId: null,
40168
40306
  access: "delete"
40169
40307
  },
40308
+ "ptz.getHomePreset": {
40309
+ capName: "ptz",
40310
+ capScope: "device",
40311
+ addonId: null,
40312
+ access: "view"
40313
+ },
40170
40314
  "ptz.getOptions": {
40171
40315
  capName: "ptz",
40172
40316
  capScope: "device",
@@ -40215,6 +40359,12 @@ Object.freeze({
40215
40359
  addonId: null,
40216
40360
  access: "create"
40217
40361
  },
40362
+ "ptz.setHomePreset": {
40363
+ capName: "ptz",
40364
+ capScope: "device",
40365
+ addonId: null,
40366
+ access: "create"
40367
+ },
40218
40368
  "ptz.stop": {
40219
40369
  capName: "ptz",
40220
40370
  capScope: "device",
@@ -43388,6 +43538,11 @@ Object.freeze({
43388
43538
  form: "single",
43389
43539
  optional: false
43390
43540
  }],
43541
+ "ptz.getHomePreset": [{
43542
+ name: "deviceId",
43543
+ form: "single",
43544
+ optional: false
43545
+ }],
43391
43546
  "ptz.getOptions": [{
43392
43547
  name: "deviceId",
43393
43548
  form: "single",
@@ -43428,6 +43583,11 @@ Object.freeze({
43428
43583
  form: "single",
43429
43584
  optional: false
43430
43585
  }],
43586
+ "ptz.setHomePreset": [{
43587
+ name: "deviceId",
43588
+ form: "single",
43589
+ optional: false
43590
+ }],
43431
43591
  "ptz.stop": [{
43432
43592
  name: "deviceId",
43433
43593
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
5359
5359
  var ZodFirstPartyTypeKind;
5360
5360
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5361
5361
  //#endregion
5362
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5362
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5363
5363
  /**
5364
5364
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5365
5365
  * window to float samples (D455).
@@ -30868,14 +30868,81 @@ var privacyMaskCapability = {
30868
30868
  * whether persisting is worth a SQLite commit. */
30869
30869
  volatileStateFields: ["lastFetchedAt"]
30870
30870
  };
30871
+ /**
30872
+ * What a preset id DOES on this camera.
30873
+ *
30874
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30875
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30876
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30877
+ * firmware:
30878
+ *
30879
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30880
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30881
+ * 95 Call OSD menu
30882
+ *
30883
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30884
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30885
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30886
+ * operator as a transport failure.
30887
+ *
30888
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30889
+ * is the single most useful thing that camera can do. Only `savePreset` and
30890
+ * `deletePreset` are gated.
30891
+ */
30892
+ var PtzPresetFunctionSchema = _enum([
30893
+ "home",
30894
+ "day-mode",
30895
+ "night-mode",
30896
+ "day-night-auto",
30897
+ "set-limits",
30898
+ "save-limits",
30899
+ "reboot",
30900
+ "osd-menu"
30901
+ ]);
30871
30902
  var PtzPresetSchema = object({
30872
30903
  id: string(),
30873
- name: string()
30904
+ name: string(),
30905
+ /**
30906
+ * The firmware function this id performs, when the provider KNOWS the id is
30907
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
30908
+ * provider does not recognise -- the two are told apart by `writable`.
30909
+ */
30910
+ fn: PtzPresetFunctionSchema.nullable(),
30911
+ /**
30912
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
30913
+ * it false only for a band it KNOWS is reserved; where the firmware is not
30914
+ * documented it stays true and a refusal comes from the camera, named.
30915
+ */
30916
+ writable: boolean()
30874
30917
  });
30918
+ /**
30919
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
30920
+ * read it.
30921
+ *
30922
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
30923
+ * position no way to say so. All four said `0`:
30924
+ *
30925
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
30926
+ * path lands upstream"
30927
+ * hikvision stub, "firmware-dependent and frequently absent"
30928
+ * amcrest stub, "no generic absolute-position read for this model family"
30929
+ * onvif throws
30930
+ *
30931
+ * So every consumer asking where a camera points was told "perfectly centred"
30932
+ * by four cameras that had never looked. That is D393 -- a measurement that
30933
+ * FAILED is `null`, never `0`, and the type says so all the way to the
30934
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
30935
+ * headroom", which evacuated a healthy disk.
30936
+ *
30937
+ * D393 also says to check for a narrower structural TWIN of the result type.
30938
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
30939
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
30940
+ * tells callers to migrate to.
30941
+ */
30875
30942
  var PtzPositionSchema = object({
30876
- pan: number(),
30877
- tilt: number(),
30878
- zoom: number()
30943
+ pan: number().nullable(),
30944
+ tilt: number().nullable(),
30945
+ zoom: number().nullable()
30879
30946
  });
30880
30947
  var PtzMoveCommandSchema = object({
30881
30948
  pan: number().optional(),
@@ -30894,7 +30961,72 @@ var PtzOptionsSchema = object({
30894
30961
  maxPresets: number().optional(),
30895
30962
  /** Whether the camera exposes a controllable autofocus toggle
30896
30963
  * (boolean `hasX` per the getOptions availability convention). */
30897
- hasAutofocus: boolean()
30964
+ hasAutofocus: boolean(),
30965
+ /**
30966
+ * How many distinct speeds this camera's NATIVE scale offers.
30967
+ *
30968
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
30969
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
30970
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
30971
+ * meaningless, because it has eight steps and three of them round to the
30972
+ * same one. A loop that tunes its own gain has to know the granularity of
30973
+ * the knob it is turning.
30974
+ *
30975
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
30976
+ * a float). Never a made-up number.
30977
+ */
30978
+ speedSteps: number().int().positive().nullable(),
30979
+ /**
30980
+ * How long ONE `move` pulse runs on this driver, ms.
30981
+ *
30982
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
30983
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
30984
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
30985
+ * did the head travel per pulse": without it a measured displacement has no
30986
+ * gain to be divided into.
30987
+ *
30988
+ * `null` = the driver cannot say.
30989
+ */
30990
+ moveImpulseMs: number().int().positive().nullable()
30991
+ });
30992
+ /**
30993
+ * Which preset `goHome` goes to, and WHO decided.
30994
+ *
30995
+ * `goHome` used to be three vendor "conventions" written in three comments --
30996
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
30997
+ * not one of the three cameras honours its own:
30998
+ *
30999
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31000
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31001
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31002
+ *
31003
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31004
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31005
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31006
+ * needs an answer that is true per camera and audible when it is missing.
31007
+ *
31008
+ * `source` is what makes it honest:
31009
+ * - `operator` -- picked in the UI, stored by the provider.
31010
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31011
+ * "Back to origin"), adopted as the default with nothing to configure.
31012
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31013
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31014
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31015
+ * no picker.
31016
+ * - `none` -- nothing is configured and the camera names nothing.
31017
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31018
+ *
31019
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31020
+ * native case has no preset and homes perfectly well.
31021
+ */
31022
+ var PtzHomePresetSchema = object({
31023
+ presetId: string().nullable(),
31024
+ source: _enum([
31025
+ "operator",
31026
+ "firmware",
31027
+ "native",
31028
+ "none"
31029
+ ])
30898
31030
  });
30899
31031
  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({
30900
31032
  deviceId: number(),
@@ -30912,7 +31044,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
30912
31044
  }), _void(), {
30913
31045
  kind: "mutation",
30914
31046
  auth: "admin"
30915
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31047
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31048
+ deviceId: number(),
31049
+ presetId: string().nullable()
31050
+ }), _void(), {
31051
+ kind: "mutation",
31052
+ auth: "admin"
31053
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
30916
31054
  deviceId: number(),
30917
31055
  enabled: boolean()
30918
31056
  }), _void(), { kind: "mutation" });
@@ -40166,6 +40304,12 @@ Object.freeze({
40166
40304
  addonId: null,
40167
40305
  access: "delete"
40168
40306
  },
40307
+ "ptz.getHomePreset": {
40308
+ capName: "ptz",
40309
+ capScope: "device",
40310
+ addonId: null,
40311
+ access: "view"
40312
+ },
40169
40313
  "ptz.getOptions": {
40170
40314
  capName: "ptz",
40171
40315
  capScope: "device",
@@ -40214,6 +40358,12 @@ Object.freeze({
40214
40358
  addonId: null,
40215
40359
  access: "create"
40216
40360
  },
40361
+ "ptz.setHomePreset": {
40362
+ capName: "ptz",
40363
+ capScope: "device",
40364
+ addonId: null,
40365
+ access: "create"
40366
+ },
40217
40367
  "ptz.stop": {
40218
40368
  capName: "ptz",
40219
40369
  capScope: "device",
@@ -43387,6 +43537,11 @@ Object.freeze({
43387
43537
  form: "single",
43388
43538
  optional: false
43389
43539
  }],
43540
+ "ptz.getHomePreset": [{
43541
+ name: "deviceId",
43542
+ form: "single",
43543
+ optional: false
43544
+ }],
43390
43545
  "ptz.getOptions": [{
43391
43546
  name: "deviceId",
43392
43547
  form: "single",
@@ -43427,6 +43582,11 @@ Object.freeze({
43427
43582
  form: "single",
43428
43583
  optional: false
43429
43584
  }],
43585
+ "ptz.setHomePreset": [{
43586
+ name: "deviceId",
43587
+ form: "single",
43588
+ optional: false
43589
+ }],
43430
43590
  "ptz.stop": [{
43431
43591
  name: "deviceId",
43432
43592
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.110",
3
+ "version": "0.2.111",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",