@camstack/addon-provider-homematic 1.2.110 → 1.2.112

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
@@ -5369,7 +5369,7 @@ var ZodIssueCode = {
5369
5369
  var ZodFirstPartyTypeKind;
5370
5370
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5371
5371
  //#endregion
5372
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5372
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5373
5373
  /**
5374
5374
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5375
5375
  * window to float samples (D455).
@@ -30944,14 +30944,81 @@ var privacyMaskCapability = {
30944
30944
  * whether persisting is worth a SQLite commit. */
30945
30945
  volatileStateFields: ["lastFetchedAt"]
30946
30946
  };
30947
+ /**
30948
+ * What a preset id DOES on this camera.
30949
+ *
30950
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30951
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30952
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30953
+ * firmware:
30954
+ *
30955
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30956
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30957
+ * 95 Call OSD menu
30958
+ *
30959
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30960
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30961
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30962
+ * operator as a transport failure.
30963
+ *
30964
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30965
+ * is the single most useful thing that camera can do. Only `savePreset` and
30966
+ * `deletePreset` are gated.
30967
+ */
30968
+ var PtzPresetFunctionSchema = _enum([
30969
+ "home",
30970
+ "day-mode",
30971
+ "night-mode",
30972
+ "day-night-auto",
30973
+ "set-limits",
30974
+ "save-limits",
30975
+ "reboot",
30976
+ "osd-menu"
30977
+ ]);
30947
30978
  var PtzPresetSchema = object({
30948
30979
  id: string(),
30949
- name: string()
30980
+ name: string(),
30981
+ /**
30982
+ * The firmware function this id performs, when the provider KNOWS the id is
30983
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
30984
+ * provider does not recognise -- the two are told apart by `writable`.
30985
+ */
30986
+ fn: PtzPresetFunctionSchema.nullable(),
30987
+ /**
30988
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
30989
+ * it false only for a band it KNOWS is reserved; where the firmware is not
30990
+ * documented it stays true and a refusal comes from the camera, named.
30991
+ */
30992
+ writable: boolean()
30950
30993
  });
30994
+ /**
30995
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
30996
+ * read it.
30997
+ *
30998
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
30999
+ * position no way to say so. All four said `0`:
31000
+ *
31001
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31002
+ * path lands upstream"
31003
+ * hikvision stub, "firmware-dependent and frequently absent"
31004
+ * amcrest stub, "no generic absolute-position read for this model family"
31005
+ * onvif throws
31006
+ *
31007
+ * So every consumer asking where a camera points was told "perfectly centred"
31008
+ * by four cameras that had never looked. That is D393 -- a measurement that
31009
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31010
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31011
+ * headroom", which evacuated a healthy disk.
31012
+ *
31013
+ * D393 also says to check for a narrower structural TWIN of the result type.
31014
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31015
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31016
+ * tells callers to migrate to.
31017
+ */
30951
31018
  var PtzPositionSchema = object({
30952
- pan: number(),
30953
- tilt: number(),
30954
- zoom: number()
31019
+ pan: number().nullable(),
31020
+ tilt: number().nullable(),
31021
+ zoom: number().nullable()
30955
31022
  });
30956
31023
  var PtzMoveCommandSchema = object({
30957
31024
  pan: number().optional(),
@@ -30970,7 +31037,72 @@ var PtzOptionsSchema = object({
30970
31037
  maxPresets: number().optional(),
30971
31038
  /** Whether the camera exposes a controllable autofocus toggle
30972
31039
  * (boolean `hasX` per the getOptions availability convention). */
30973
- hasAutofocus: boolean()
31040
+ hasAutofocus: boolean(),
31041
+ /**
31042
+ * How many distinct speeds this camera's NATIVE scale offers.
31043
+ *
31044
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31045
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31046
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31047
+ * meaningless, because it has eight steps and three of them round to the
31048
+ * same one. A loop that tunes its own gain has to know the granularity of
31049
+ * the knob it is turning.
31050
+ *
31051
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31052
+ * a float). Never a made-up number.
31053
+ */
31054
+ speedSteps: number().int().positive().nullable(),
31055
+ /**
31056
+ * How long ONE `move` pulse runs on this driver, ms.
31057
+ *
31058
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31059
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31060
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31061
+ * did the head travel per pulse": without it a measured displacement has no
31062
+ * gain to be divided into.
31063
+ *
31064
+ * `null` = the driver cannot say.
31065
+ */
31066
+ moveImpulseMs: number().int().positive().nullable()
31067
+ });
31068
+ /**
31069
+ * Which preset `goHome` goes to, and WHO decided.
31070
+ *
31071
+ * `goHome` used to be three vendor "conventions" written in three comments --
31072
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31073
+ * not one of the three cameras honours its own:
31074
+ *
31075
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31076
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31077
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31078
+ *
31079
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31080
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31081
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31082
+ * needs an answer that is true per camera and audible when it is missing.
31083
+ *
31084
+ * `source` is what makes it honest:
31085
+ * - `operator` -- picked in the UI, stored by the provider.
31086
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31087
+ * "Back to origin"), adopted as the default with nothing to configure.
31088
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31089
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31090
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31091
+ * no picker.
31092
+ * - `none` -- nothing is configured and the camera names nothing.
31093
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31094
+ *
31095
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31096
+ * native case has no preset and homes perfectly well.
31097
+ */
31098
+ var PtzHomePresetSchema = object({
31099
+ presetId: string().nullable(),
31100
+ source: _enum([
31101
+ "operator",
31102
+ "firmware",
31103
+ "native",
31104
+ "none"
31105
+ ])
30974
31106
  });
30975
31107
  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({
30976
31108
  deviceId: number(),
@@ -30988,7 +31120,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
30988
31120
  }), _void(), {
30989
31121
  kind: "mutation",
30990
31122
  auth: "admin"
30991
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31123
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31124
+ deviceId: number(),
31125
+ presetId: string().nullable()
31126
+ }), _void(), {
31127
+ kind: "mutation",
31128
+ auth: "admin"
31129
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
30992
31130
  deviceId: number(),
30993
31131
  enabled: boolean()
30994
31132
  }), _void(), { kind: "mutation" });
@@ -40242,6 +40380,12 @@ Object.freeze({
40242
40380
  addonId: null,
40243
40381
  access: "delete"
40244
40382
  },
40383
+ "ptz.getHomePreset": {
40384
+ capName: "ptz",
40385
+ capScope: "device",
40386
+ addonId: null,
40387
+ access: "view"
40388
+ },
40245
40389
  "ptz.getOptions": {
40246
40390
  capName: "ptz",
40247
40391
  capScope: "device",
@@ -40290,6 +40434,12 @@ Object.freeze({
40290
40434
  addonId: null,
40291
40435
  access: "create"
40292
40436
  },
40437
+ "ptz.setHomePreset": {
40438
+ capName: "ptz",
40439
+ capScope: "device",
40440
+ addonId: null,
40441
+ access: "create"
40442
+ },
40293
40443
  "ptz.stop": {
40294
40444
  capName: "ptz",
40295
40445
  capScope: "device",
@@ -43463,6 +43613,11 @@ Object.freeze({
43463
43613
  form: "single",
43464
43614
  optional: false
43465
43615
  }],
43616
+ "ptz.getHomePreset": [{
43617
+ name: "deviceId",
43618
+ form: "single",
43619
+ optional: false
43620
+ }],
43466
43621
  "ptz.getOptions": [{
43467
43622
  name: "deviceId",
43468
43623
  form: "single",
@@ -43503,6 +43658,11 @@ Object.freeze({
43503
43658
  form: "single",
43504
43659
  optional: false
43505
43660
  }],
43661
+ "ptz.setHomePreset": [{
43662
+ name: "deviceId",
43663
+ form: "single",
43664
+ optional: false
43665
+ }],
43506
43666
  "ptz.stop": [{
43507
43667
  name: "deviceId",
43508
43668
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5370,7 +5370,7 @@ var ZodIssueCode = {
5370
5370
  var ZodFirstPartyTypeKind;
5371
5371
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5372
5372
  //#endregion
5373
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5373
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5374
5374
  /**
5375
5375
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5376
5376
  * window to float samples (D455).
@@ -30945,14 +30945,81 @@ var privacyMaskCapability = {
30945
30945
  * whether persisting is worth a SQLite commit. */
30946
30946
  volatileStateFields: ["lastFetchedAt"]
30947
30947
  };
30948
+ /**
30949
+ * What a preset id DOES on this camera.
30950
+ *
30951
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30952
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30953
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30954
+ * firmware:
30955
+ *
30956
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30957
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30958
+ * 95 Call OSD menu
30959
+ *
30960
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30961
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30962
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30963
+ * operator as a transport failure.
30964
+ *
30965
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30966
+ * is the single most useful thing that camera can do. Only `savePreset` and
30967
+ * `deletePreset` are gated.
30968
+ */
30969
+ var PtzPresetFunctionSchema = _enum([
30970
+ "home",
30971
+ "day-mode",
30972
+ "night-mode",
30973
+ "day-night-auto",
30974
+ "set-limits",
30975
+ "save-limits",
30976
+ "reboot",
30977
+ "osd-menu"
30978
+ ]);
30948
30979
  var PtzPresetSchema = object({
30949
30980
  id: string(),
30950
- name: string()
30981
+ name: string(),
30982
+ /**
30983
+ * The firmware function this id performs, when the provider KNOWS the id is
30984
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
30985
+ * provider does not recognise -- the two are told apart by `writable`.
30986
+ */
30987
+ fn: PtzPresetFunctionSchema.nullable(),
30988
+ /**
30989
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
30990
+ * it false only for a band it KNOWS is reserved; where the firmware is not
30991
+ * documented it stays true and a refusal comes from the camera, named.
30992
+ */
30993
+ writable: boolean()
30951
30994
  });
30995
+ /**
30996
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
30997
+ * read it.
30998
+ *
30999
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31000
+ * position no way to say so. All four said `0`:
31001
+ *
31002
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31003
+ * path lands upstream"
31004
+ * hikvision stub, "firmware-dependent and frequently absent"
31005
+ * amcrest stub, "no generic absolute-position read for this model family"
31006
+ * onvif throws
31007
+ *
31008
+ * So every consumer asking where a camera points was told "perfectly centred"
31009
+ * by four cameras that had never looked. That is D393 -- a measurement that
31010
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31011
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31012
+ * headroom", which evacuated a healthy disk.
31013
+ *
31014
+ * D393 also says to check for a narrower structural TWIN of the result type.
31015
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31016
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31017
+ * tells callers to migrate to.
31018
+ */
30952
31019
  var PtzPositionSchema = object({
30953
- pan: number(),
30954
- tilt: number(),
30955
- zoom: number()
31020
+ pan: number().nullable(),
31021
+ tilt: number().nullable(),
31022
+ zoom: number().nullable()
30956
31023
  });
30957
31024
  var PtzMoveCommandSchema = object({
30958
31025
  pan: number().optional(),
@@ -30971,7 +31038,72 @@ var PtzOptionsSchema = object({
30971
31038
  maxPresets: number().optional(),
30972
31039
  /** Whether the camera exposes a controllable autofocus toggle
30973
31040
  * (boolean `hasX` per the getOptions availability convention). */
30974
- hasAutofocus: boolean()
31041
+ hasAutofocus: boolean(),
31042
+ /**
31043
+ * How many distinct speeds this camera's NATIVE scale offers.
31044
+ *
31045
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31046
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31047
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31048
+ * meaningless, because it has eight steps and three of them round to the
31049
+ * same one. A loop that tunes its own gain has to know the granularity of
31050
+ * the knob it is turning.
31051
+ *
31052
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31053
+ * a float). Never a made-up number.
31054
+ */
31055
+ speedSteps: number().int().positive().nullable(),
31056
+ /**
31057
+ * How long ONE `move` pulse runs on this driver, ms.
31058
+ *
31059
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31060
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31061
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31062
+ * did the head travel per pulse": without it a measured displacement has no
31063
+ * gain to be divided into.
31064
+ *
31065
+ * `null` = the driver cannot say.
31066
+ */
31067
+ moveImpulseMs: number().int().positive().nullable()
31068
+ });
31069
+ /**
31070
+ * Which preset `goHome` goes to, and WHO decided.
31071
+ *
31072
+ * `goHome` used to be three vendor "conventions" written in three comments --
31073
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31074
+ * not one of the three cameras honours its own:
31075
+ *
31076
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31077
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31078
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31079
+ *
31080
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31081
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31082
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31083
+ * needs an answer that is true per camera and audible when it is missing.
31084
+ *
31085
+ * `source` is what makes it honest:
31086
+ * - `operator` -- picked in the UI, stored by the provider.
31087
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31088
+ * "Back to origin"), adopted as the default with nothing to configure.
31089
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31090
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31091
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31092
+ * no picker.
31093
+ * - `none` -- nothing is configured and the camera names nothing.
31094
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31095
+ *
31096
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31097
+ * native case has no preset and homes perfectly well.
31098
+ */
31099
+ var PtzHomePresetSchema = object({
31100
+ presetId: string().nullable(),
31101
+ source: _enum([
31102
+ "operator",
31103
+ "firmware",
31104
+ "native",
31105
+ "none"
31106
+ ])
30975
31107
  });
30976
31108
  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({
30977
31109
  deviceId: number(),
@@ -30989,7 +31121,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
30989
31121
  }), _void(), {
30990
31122
  kind: "mutation",
30991
31123
  auth: "admin"
30992
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31124
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31125
+ deviceId: number(),
31126
+ presetId: string().nullable()
31127
+ }), _void(), {
31128
+ kind: "mutation",
31129
+ auth: "admin"
31130
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
30993
31131
  deviceId: number(),
30994
31132
  enabled: boolean()
30995
31133
  }), _void(), { kind: "mutation" });
@@ -40243,6 +40381,12 @@ Object.freeze({
40243
40381
  addonId: null,
40244
40382
  access: "delete"
40245
40383
  },
40384
+ "ptz.getHomePreset": {
40385
+ capName: "ptz",
40386
+ capScope: "device",
40387
+ addonId: null,
40388
+ access: "view"
40389
+ },
40246
40390
  "ptz.getOptions": {
40247
40391
  capName: "ptz",
40248
40392
  capScope: "device",
@@ -40291,6 +40435,12 @@ Object.freeze({
40291
40435
  addonId: null,
40292
40436
  access: "create"
40293
40437
  },
40438
+ "ptz.setHomePreset": {
40439
+ capName: "ptz",
40440
+ capScope: "device",
40441
+ addonId: null,
40442
+ access: "create"
40443
+ },
40294
40444
  "ptz.stop": {
40295
40445
  capName: "ptz",
40296
40446
  capScope: "device",
@@ -43464,6 +43614,11 @@ Object.freeze({
43464
43614
  form: "single",
43465
43615
  optional: false
43466
43616
  }],
43617
+ "ptz.getHomePreset": [{
43618
+ name: "deviceId",
43619
+ form: "single",
43620
+ optional: false
43621
+ }],
43467
43622
  "ptz.getOptions": [{
43468
43623
  name: "deviceId",
43469
43624
  form: "single",
@@ -43504,6 +43659,11 @@ Object.freeze({
43504
43659
  form: "single",
43505
43660
  optional: false
43506
43661
  }],
43662
+ "ptz.setHomePreset": [{
43663
+ name: "deviceId",
43664
+ form: "single",
43665
+ optional: false
43666
+ }],
43507
43667
  "ptz.stop": [{
43508
43668
  name: "deviceId",
43509
43669
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homematic",
3
- "version": "1.2.110",
3
+ "version": "1.2.112",
4
4
  "description": "Homematic / HomematicIP (CCU3 / RaspberryMatic) device-provider addon for CamStack — wraps the nodehomematic library",
5
5
  "keywords": [
6
6
  "camstack",