@camstack/addon-provider-gree 0.2.108 → 0.2.110

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