@camstack/addon-provider-homeassistant 1.2.133 → 1.2.135

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-BsxXcblv.js");
2
+ const require_dist = require("./dist-CBess7Ok.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-device-source.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-BEWasBMp.mjs";
1
+ import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-Byg3We_8.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-device-source.ts
@@ -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-vl6nBE8d.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).
@@ -31344,14 +31344,81 @@ var privacyMaskCapability = {
31344
31344
  * whether persisting is worth a SQLite commit. */
31345
31345
  volatileStateFields: ["lastFetchedAt"]
31346
31346
  };
31347
+ /**
31348
+ * What a preset id DOES on this camera.
31349
+ *
31350
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31351
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31352
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31353
+ * firmware:
31354
+ *
31355
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31356
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31357
+ * 95 Call OSD menu
31358
+ *
31359
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31360
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31361
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31362
+ * operator as a transport failure.
31363
+ *
31364
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31365
+ * is the single most useful thing that camera can do. Only `savePreset` and
31366
+ * `deletePreset` are gated.
31367
+ */
31368
+ var PtzPresetFunctionSchema = _enum([
31369
+ "home",
31370
+ "day-mode",
31371
+ "night-mode",
31372
+ "day-night-auto",
31373
+ "set-limits",
31374
+ "save-limits",
31375
+ "reboot",
31376
+ "osd-menu"
31377
+ ]);
31347
31378
  var PtzPresetSchema = object({
31348
31379
  id: string(),
31349
- name: string()
31380
+ name: string(),
31381
+ /**
31382
+ * The firmware function this id performs, when the provider KNOWS the id is
31383
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31384
+ * provider does not recognise -- the two are told apart by `writable`.
31385
+ */
31386
+ fn: PtzPresetFunctionSchema.nullable(),
31387
+ /**
31388
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31389
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31390
+ * documented it stays true and a refusal comes from the camera, named.
31391
+ */
31392
+ writable: boolean()
31350
31393
  });
31394
+ /**
31395
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31396
+ * read it.
31397
+ *
31398
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31399
+ * position no way to say so. All four said `0`:
31400
+ *
31401
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31402
+ * path lands upstream"
31403
+ * hikvision stub, "firmware-dependent and frequently absent"
31404
+ * amcrest stub, "no generic absolute-position read for this model family"
31405
+ * onvif throws
31406
+ *
31407
+ * So every consumer asking where a camera points was told "perfectly centred"
31408
+ * by four cameras that had never looked. That is D393 -- a measurement that
31409
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31410
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31411
+ * headroom", which evacuated a healthy disk.
31412
+ *
31413
+ * D393 also says to check for a narrower structural TWIN of the result type.
31414
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31415
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31416
+ * tells callers to migrate to.
31417
+ */
31351
31418
  var PtzPositionSchema = object({
31352
- pan: number(),
31353
- tilt: number(),
31354
- zoom: number()
31419
+ pan: number().nullable(),
31420
+ tilt: number().nullable(),
31421
+ zoom: number().nullable()
31355
31422
  });
31356
31423
  var PtzMoveCommandSchema = object({
31357
31424
  pan: number().optional(),
@@ -31370,7 +31437,72 @@ var PtzOptionsSchema = object({
31370
31437
  maxPresets: number().optional(),
31371
31438
  /** Whether the camera exposes a controllable autofocus toggle
31372
31439
  * (boolean `hasX` per the getOptions availability convention). */
31373
- hasAutofocus: boolean()
31440
+ hasAutofocus: boolean(),
31441
+ /**
31442
+ * How many distinct speeds this camera's NATIVE scale offers.
31443
+ *
31444
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31445
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31446
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31447
+ * meaningless, because it has eight steps and three of them round to the
31448
+ * same one. A loop that tunes its own gain has to know the granularity of
31449
+ * the knob it is turning.
31450
+ *
31451
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31452
+ * a float). Never a made-up number.
31453
+ */
31454
+ speedSteps: number().int().positive().nullable(),
31455
+ /**
31456
+ * How long ONE `move` pulse runs on this driver, ms.
31457
+ *
31458
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31459
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31460
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31461
+ * did the head travel per pulse": without it a measured displacement has no
31462
+ * gain to be divided into.
31463
+ *
31464
+ * `null` = the driver cannot say.
31465
+ */
31466
+ moveImpulseMs: number().int().positive().nullable()
31467
+ });
31468
+ /**
31469
+ * Which preset `goHome` goes to, and WHO decided.
31470
+ *
31471
+ * `goHome` used to be three vendor "conventions" written in three comments --
31472
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31473
+ * not one of the three cameras honours its own:
31474
+ *
31475
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31476
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31477
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31478
+ *
31479
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31480
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31481
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31482
+ * needs an answer that is true per camera and audible when it is missing.
31483
+ *
31484
+ * `source` is what makes it honest:
31485
+ * - `operator` -- picked in the UI, stored by the provider.
31486
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31487
+ * "Back to origin"), adopted as the default with nothing to configure.
31488
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31489
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31490
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31491
+ * no picker.
31492
+ * - `none` -- nothing is configured and the camera names nothing.
31493
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31494
+ *
31495
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31496
+ * native case has no preset and homes perfectly well.
31497
+ */
31498
+ var PtzHomePresetSchema = object({
31499
+ presetId: string().nullable(),
31500
+ source: _enum([
31501
+ "operator",
31502
+ "firmware",
31503
+ "native",
31504
+ "none"
31505
+ ])
31374
31506
  });
31375
31507
  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({
31376
31508
  deviceId: number(),
@@ -31388,7 +31520,22 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31388
31520
  }), _void(), {
31389
31521
  kind: "mutation",
31390
31522
  auth: "admin"
31391
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31523
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31524
+ deviceId: number(),
31525
+ presetId: string().nullable()
31526
+ }), _void(), {
31527
+ kind: "mutation",
31528
+ auth: "admin"
31529
+ }), method(object({ deviceId: number() }), _void(), {
31530
+ kind: "mutation",
31531
+ auth: "admin"
31532
+ }), method(object({ deviceId: number() }), number().int().nullable()), method(object({
31533
+ deviceId: number(),
31534
+ seconds: number().int().min(0).max(3600)
31535
+ }), _void(), {
31536
+ kind: "mutation",
31537
+ auth: "admin"
31538
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31392
31539
  deviceId: number(),
31393
31540
  enabled: boolean()
31394
31541
  }), _void(), { kind: "mutation" });
@@ -40630,6 +40777,12 @@ Object.freeze({
40630
40777
  addonId: null,
40631
40778
  access: "create"
40632
40779
  },
40780
+ "ptz.captureHomeHere": {
40781
+ capName: "ptz",
40782
+ capScope: "device",
40783
+ addonId: null,
40784
+ access: "create"
40785
+ },
40633
40786
  "ptz.continuousMove": {
40634
40787
  capName: "ptz",
40635
40788
  capScope: "device",
@@ -40642,6 +40795,18 @@ Object.freeze({
40642
40795
  addonId: null,
40643
40796
  access: "delete"
40644
40797
  },
40798
+ "ptz.getHomePreset": {
40799
+ capName: "ptz",
40800
+ capScope: "device",
40801
+ addonId: null,
40802
+ access: "view"
40803
+ },
40804
+ "ptz.getHomeReturnSeconds": {
40805
+ capName: "ptz",
40806
+ capScope: "device",
40807
+ addonId: null,
40808
+ access: "view"
40809
+ },
40645
40810
  "ptz.getOptions": {
40646
40811
  capName: "ptz",
40647
40812
  capScope: "device",
@@ -40690,6 +40855,18 @@ Object.freeze({
40690
40855
  addonId: null,
40691
40856
  access: "create"
40692
40857
  },
40858
+ "ptz.setHomePreset": {
40859
+ capName: "ptz",
40860
+ capScope: "device",
40861
+ addonId: null,
40862
+ access: "create"
40863
+ },
40864
+ "ptz.setHomeReturnSeconds": {
40865
+ capName: "ptz",
40866
+ capScope: "device",
40867
+ addonId: null,
40868
+ access: "create"
40869
+ },
40693
40870
  "ptz.stop": {
40694
40871
  capName: "ptz",
40695
40872
  capScope: "device",
@@ -43853,6 +44030,11 @@ Object.freeze({
43853
44030
  form: "single",
43854
44031
  optional: false
43855
44032
  }],
44033
+ "ptz.captureHomeHere": [{
44034
+ name: "deviceId",
44035
+ form: "single",
44036
+ optional: false
44037
+ }],
43856
44038
  "ptz.continuousMove": [{
43857
44039
  name: "deviceId",
43858
44040
  form: "single",
@@ -43863,6 +44045,16 @@ Object.freeze({
43863
44045
  form: "single",
43864
44046
  optional: false
43865
44047
  }],
44048
+ "ptz.getHomePreset": [{
44049
+ name: "deviceId",
44050
+ form: "single",
44051
+ optional: false
44052
+ }],
44053
+ "ptz.getHomeReturnSeconds": [{
44054
+ name: "deviceId",
44055
+ form: "single",
44056
+ optional: false
44057
+ }],
43866
44058
  "ptz.getOptions": [{
43867
44059
  name: "deviceId",
43868
44060
  form: "single",
@@ -43903,6 +44095,16 @@ Object.freeze({
43903
44095
  form: "single",
43904
44096
  optional: false
43905
44097
  }],
44098
+ "ptz.setHomePreset": [{
44099
+ name: "deviceId",
44100
+ form: "single",
44101
+ optional: false
44102
+ }],
44103
+ "ptz.setHomeReturnSeconds": [{
44104
+ name: "deviceId",
44105
+ form: "single",
44106
+ optional: false
44107
+ }],
43906
44108
  "ptz.stop": [{
43907
44109
  name: "deviceId",
43908
44110
  form: "single",
@@ -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-vl6nBE8d.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).
@@ -31344,14 +31344,81 @@ var privacyMaskCapability = {
31344
31344
  * whether persisting is worth a SQLite commit. */
31345
31345
  volatileStateFields: ["lastFetchedAt"]
31346
31346
  };
31347
+ /**
31348
+ * What a preset id DOES on this camera.
31349
+ *
31350
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31351
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31352
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31353
+ * firmware:
31354
+ *
31355
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31356
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31357
+ * 95 Call OSD menu
31358
+ *
31359
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31360
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31361
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31362
+ * operator as a transport failure.
31363
+ *
31364
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31365
+ * is the single most useful thing that camera can do. Only `savePreset` and
31366
+ * `deletePreset` are gated.
31367
+ */
31368
+ var PtzPresetFunctionSchema = _enum([
31369
+ "home",
31370
+ "day-mode",
31371
+ "night-mode",
31372
+ "day-night-auto",
31373
+ "set-limits",
31374
+ "save-limits",
31375
+ "reboot",
31376
+ "osd-menu"
31377
+ ]);
31347
31378
  var PtzPresetSchema = object({
31348
31379
  id: string(),
31349
- name: string()
31380
+ name: string(),
31381
+ /**
31382
+ * The firmware function this id performs, when the provider KNOWS the id is
31383
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31384
+ * provider does not recognise -- the two are told apart by `writable`.
31385
+ */
31386
+ fn: PtzPresetFunctionSchema.nullable(),
31387
+ /**
31388
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31389
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31390
+ * documented it stays true and a refusal comes from the camera, named.
31391
+ */
31392
+ writable: boolean()
31350
31393
  });
31394
+ /**
31395
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31396
+ * read it.
31397
+ *
31398
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31399
+ * position no way to say so. All four said `0`:
31400
+ *
31401
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31402
+ * path lands upstream"
31403
+ * hikvision stub, "firmware-dependent and frequently absent"
31404
+ * amcrest stub, "no generic absolute-position read for this model family"
31405
+ * onvif throws
31406
+ *
31407
+ * So every consumer asking where a camera points was told "perfectly centred"
31408
+ * by four cameras that had never looked. That is D393 -- a measurement that
31409
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31410
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31411
+ * headroom", which evacuated a healthy disk.
31412
+ *
31413
+ * D393 also says to check for a narrower structural TWIN of the result type.
31414
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31415
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31416
+ * tells callers to migrate to.
31417
+ */
31351
31418
  var PtzPositionSchema = object({
31352
- pan: number(),
31353
- tilt: number(),
31354
- zoom: number()
31419
+ pan: number().nullable(),
31420
+ tilt: number().nullable(),
31421
+ zoom: number().nullable()
31355
31422
  });
31356
31423
  var PtzMoveCommandSchema = object({
31357
31424
  pan: number().optional(),
@@ -31370,7 +31437,72 @@ var PtzOptionsSchema = object({
31370
31437
  maxPresets: number().optional(),
31371
31438
  /** Whether the camera exposes a controllable autofocus toggle
31372
31439
  * (boolean `hasX` per the getOptions availability convention). */
31373
- hasAutofocus: boolean()
31440
+ hasAutofocus: boolean(),
31441
+ /**
31442
+ * How many distinct speeds this camera's NATIVE scale offers.
31443
+ *
31444
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31445
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31446
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31447
+ * meaningless, because it has eight steps and three of them round to the
31448
+ * same one. A loop that tunes its own gain has to know the granularity of
31449
+ * the knob it is turning.
31450
+ *
31451
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31452
+ * a float). Never a made-up number.
31453
+ */
31454
+ speedSteps: number().int().positive().nullable(),
31455
+ /**
31456
+ * How long ONE `move` pulse runs on this driver, ms.
31457
+ *
31458
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31459
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31460
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31461
+ * did the head travel per pulse": without it a measured displacement has no
31462
+ * gain to be divided into.
31463
+ *
31464
+ * `null` = the driver cannot say.
31465
+ */
31466
+ moveImpulseMs: number().int().positive().nullable()
31467
+ });
31468
+ /**
31469
+ * Which preset `goHome` goes to, and WHO decided.
31470
+ *
31471
+ * `goHome` used to be three vendor "conventions" written in three comments --
31472
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31473
+ * not one of the three cameras honours its own:
31474
+ *
31475
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31476
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31477
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31478
+ *
31479
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31480
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31481
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31482
+ * needs an answer that is true per camera and audible when it is missing.
31483
+ *
31484
+ * `source` is what makes it honest:
31485
+ * - `operator` -- picked in the UI, stored by the provider.
31486
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31487
+ * "Back to origin"), adopted as the default with nothing to configure.
31488
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31489
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31490
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31491
+ * no picker.
31492
+ * - `none` -- nothing is configured and the camera names nothing.
31493
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31494
+ *
31495
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31496
+ * native case has no preset and homes perfectly well.
31497
+ */
31498
+ var PtzHomePresetSchema = object({
31499
+ presetId: string().nullable(),
31500
+ source: _enum([
31501
+ "operator",
31502
+ "firmware",
31503
+ "native",
31504
+ "none"
31505
+ ])
31374
31506
  });
31375
31507
  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({
31376
31508
  deviceId: number(),
@@ -31388,7 +31520,22 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31388
31520
  }), _void(), {
31389
31521
  kind: "mutation",
31390
31522
  auth: "admin"
31391
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31523
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31524
+ deviceId: number(),
31525
+ presetId: string().nullable()
31526
+ }), _void(), {
31527
+ kind: "mutation",
31528
+ auth: "admin"
31529
+ }), method(object({ deviceId: number() }), _void(), {
31530
+ kind: "mutation",
31531
+ auth: "admin"
31532
+ }), method(object({ deviceId: number() }), number().int().nullable()), method(object({
31533
+ deviceId: number(),
31534
+ seconds: number().int().min(0).max(3600)
31535
+ }), _void(), {
31536
+ kind: "mutation",
31537
+ auth: "admin"
31538
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31392
31539
  deviceId: number(),
31393
31540
  enabled: boolean()
31394
31541
  }), _void(), { kind: "mutation" });
@@ -40630,6 +40777,12 @@ Object.freeze({
40630
40777
  addonId: null,
40631
40778
  access: "create"
40632
40779
  },
40780
+ "ptz.captureHomeHere": {
40781
+ capName: "ptz",
40782
+ capScope: "device",
40783
+ addonId: null,
40784
+ access: "create"
40785
+ },
40633
40786
  "ptz.continuousMove": {
40634
40787
  capName: "ptz",
40635
40788
  capScope: "device",
@@ -40642,6 +40795,18 @@ Object.freeze({
40642
40795
  addonId: null,
40643
40796
  access: "delete"
40644
40797
  },
40798
+ "ptz.getHomePreset": {
40799
+ capName: "ptz",
40800
+ capScope: "device",
40801
+ addonId: null,
40802
+ access: "view"
40803
+ },
40804
+ "ptz.getHomeReturnSeconds": {
40805
+ capName: "ptz",
40806
+ capScope: "device",
40807
+ addonId: null,
40808
+ access: "view"
40809
+ },
40645
40810
  "ptz.getOptions": {
40646
40811
  capName: "ptz",
40647
40812
  capScope: "device",
@@ -40690,6 +40855,18 @@ Object.freeze({
40690
40855
  addonId: null,
40691
40856
  access: "create"
40692
40857
  },
40858
+ "ptz.setHomePreset": {
40859
+ capName: "ptz",
40860
+ capScope: "device",
40861
+ addonId: null,
40862
+ access: "create"
40863
+ },
40864
+ "ptz.setHomeReturnSeconds": {
40865
+ capName: "ptz",
40866
+ capScope: "device",
40867
+ addonId: null,
40868
+ access: "create"
40869
+ },
40693
40870
  "ptz.stop": {
40694
40871
  capName: "ptz",
40695
40872
  capScope: "device",
@@ -43853,6 +44030,11 @@ Object.freeze({
43853
44030
  form: "single",
43854
44031
  optional: false
43855
44032
  }],
44033
+ "ptz.captureHomeHere": [{
44034
+ name: "deviceId",
44035
+ form: "single",
44036
+ optional: false
44037
+ }],
43856
44038
  "ptz.continuousMove": [{
43857
44039
  name: "deviceId",
43858
44040
  form: "single",
@@ -43863,6 +44045,16 @@ Object.freeze({
43863
44045
  form: "single",
43864
44046
  optional: false
43865
44047
  }],
44048
+ "ptz.getHomePreset": [{
44049
+ name: "deviceId",
44050
+ form: "single",
44051
+ optional: false
44052
+ }],
44053
+ "ptz.getHomeReturnSeconds": [{
44054
+ name: "deviceId",
44055
+ form: "single",
44056
+ optional: false
44057
+ }],
43866
44058
  "ptz.getOptions": [{
43867
44059
  name: "deviceId",
43868
44060
  form: "single",
@@ -43903,6 +44095,16 @@ Object.freeze({
43903
44095
  form: "single",
43904
44096
  optional: false
43905
44097
  }],
44098
+ "ptz.setHomePreset": [{
44099
+ name: "deviceId",
44100
+ form: "single",
44101
+ optional: false
44102
+ }],
44103
+ "ptz.setHomeReturnSeconds": [{
44104
+ name: "deviceId",
44105
+ form: "single",
44106
+ optional: false
44107
+ }],
43906
44108
  "ptz.stop": [{
43907
44109
  name: "deviceId",
43908
44110
  form: "single",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-BsxXcblv.js");
6
+ const require_dist = require("../dist-CBess7Ok.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-BEWasBMp.mjs";
1
+ import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-Byg3We_8.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.133",
3
+ "version": "1.2.135",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",