@camstack/addon-provider-homeassistant 1.2.133 → 1.2.134
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 +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-BEWasBMp.mjs → dist-CWpysI9T.mjs} +167 -7
- package/dist/{dist-BsxXcblv.js → dist-dzl9Dw-u.js} +167 -7
- package/dist/ha-export/ha-export.addon.js +1 -1
- package/dist/ha-export/ha-export.addon.mjs +1 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-dzl9Dw-u.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-
|
|
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-CWpysI9T.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-
|
|
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).
|
|
@@ -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,13 @@ 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() }),
|
|
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() }), PtzPositionSchema), method(object({
|
|
31392
31530
|
deviceId: number(),
|
|
31393
31531
|
enabled: boolean()
|
|
31394
31532
|
}), _void(), { kind: "mutation" });
|
|
@@ -40642,6 +40780,12 @@ Object.freeze({
|
|
|
40642
40780
|
addonId: null,
|
|
40643
40781
|
access: "delete"
|
|
40644
40782
|
},
|
|
40783
|
+
"ptz.getHomePreset": {
|
|
40784
|
+
capName: "ptz",
|
|
40785
|
+
capScope: "device",
|
|
40786
|
+
addonId: null,
|
|
40787
|
+
access: "view"
|
|
40788
|
+
},
|
|
40645
40789
|
"ptz.getOptions": {
|
|
40646
40790
|
capName: "ptz",
|
|
40647
40791
|
capScope: "device",
|
|
@@ -40690,6 +40834,12 @@ Object.freeze({
|
|
|
40690
40834
|
addonId: null,
|
|
40691
40835
|
access: "create"
|
|
40692
40836
|
},
|
|
40837
|
+
"ptz.setHomePreset": {
|
|
40838
|
+
capName: "ptz",
|
|
40839
|
+
capScope: "device",
|
|
40840
|
+
addonId: null,
|
|
40841
|
+
access: "create"
|
|
40842
|
+
},
|
|
40693
40843
|
"ptz.stop": {
|
|
40694
40844
|
capName: "ptz",
|
|
40695
40845
|
capScope: "device",
|
|
@@ -43863,6 +44013,11 @@ Object.freeze({
|
|
|
43863
44013
|
form: "single",
|
|
43864
44014
|
optional: false
|
|
43865
44015
|
}],
|
|
44016
|
+
"ptz.getHomePreset": [{
|
|
44017
|
+
name: "deviceId",
|
|
44018
|
+
form: "single",
|
|
44019
|
+
optional: false
|
|
44020
|
+
}],
|
|
43866
44021
|
"ptz.getOptions": [{
|
|
43867
44022
|
name: "deviceId",
|
|
43868
44023
|
form: "single",
|
|
@@ -43903,6 +44058,11 @@ Object.freeze({
|
|
|
43903
44058
|
form: "single",
|
|
43904
44059
|
optional: false
|
|
43905
44060
|
}],
|
|
44061
|
+
"ptz.setHomePreset": [{
|
|
44062
|
+
name: "deviceId",
|
|
44063
|
+
form: "single",
|
|
44064
|
+
optional: false
|
|
44065
|
+
}],
|
|
43906
44066
|
"ptz.stop": [{
|
|
43907
44067
|
name: "deviceId",
|
|
43908
44068
|
form: "single",
|
|
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
|
|
|
5359
5359
|
var ZodFirstPartyTypeKind;
|
|
5360
5360
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5361
5361
|
//#endregion
|
|
5362
|
-
//#region ../types/dist/sleep-
|
|
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).
|
|
@@ -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,13 @@ 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() }),
|
|
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() }), PtzPositionSchema), method(object({
|
|
31392
31530
|
deviceId: number(),
|
|
31393
31531
|
enabled: boolean()
|
|
31394
31532
|
}), _void(), { kind: "mutation" });
|
|
@@ -40642,6 +40780,12 @@ Object.freeze({
|
|
|
40642
40780
|
addonId: null,
|
|
40643
40781
|
access: "delete"
|
|
40644
40782
|
},
|
|
40783
|
+
"ptz.getHomePreset": {
|
|
40784
|
+
capName: "ptz",
|
|
40785
|
+
capScope: "device",
|
|
40786
|
+
addonId: null,
|
|
40787
|
+
access: "view"
|
|
40788
|
+
},
|
|
40645
40789
|
"ptz.getOptions": {
|
|
40646
40790
|
capName: "ptz",
|
|
40647
40791
|
capScope: "device",
|
|
@@ -40690,6 +40834,12 @@ Object.freeze({
|
|
|
40690
40834
|
addonId: null,
|
|
40691
40835
|
access: "create"
|
|
40692
40836
|
},
|
|
40837
|
+
"ptz.setHomePreset": {
|
|
40838
|
+
capName: "ptz",
|
|
40839
|
+
capScope: "device",
|
|
40840
|
+
addonId: null,
|
|
40841
|
+
access: "create"
|
|
40842
|
+
},
|
|
40693
40843
|
"ptz.stop": {
|
|
40694
40844
|
capName: "ptz",
|
|
40695
40845
|
capScope: "device",
|
|
@@ -43863,6 +44013,11 @@ Object.freeze({
|
|
|
43863
44013
|
form: "single",
|
|
43864
44014
|
optional: false
|
|
43865
44015
|
}],
|
|
44016
|
+
"ptz.getHomePreset": [{
|
|
44017
|
+
name: "deviceId",
|
|
44018
|
+
form: "single",
|
|
44019
|
+
optional: false
|
|
44020
|
+
}],
|
|
43866
44021
|
"ptz.getOptions": [{
|
|
43867
44022
|
name: "deviceId",
|
|
43868
44023
|
form: "single",
|
|
@@ -43903,6 +44058,11 @@ Object.freeze({
|
|
|
43903
44058
|
form: "single",
|
|
43904
44059
|
optional: false
|
|
43905
44060
|
}],
|
|
44061
|
+
"ptz.setHomePreset": [{
|
|
44062
|
+
name: "deviceId",
|
|
44063
|
+
form: "single",
|
|
44064
|
+
optional: false
|
|
44065
|
+
}],
|
|
43906
44066
|
"ptz.stop": [{
|
|
43907
44067
|
name: "deviceId",
|
|
43908
44068
|
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-
|
|
6
|
+
const require_dist = require("../dist-dzl9Dw-u.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-
|
|
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-CWpysI9T.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
//#region src/ha-export/topics.ts
|
|
4
4
|
/**
|