@camstack/addon-provider-unifi 0.2.72 → 0.2.74
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 +169 -1
- package/dist/addon.mjs +169 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -6445,6 +6445,21 @@ var CameraStreamSchema = object({
|
|
|
6445
6445
|
*/
|
|
6446
6446
|
autoEligible: boolean().optional(),
|
|
6447
6447
|
/**
|
|
6448
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6449
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6450
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6451
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6452
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6453
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6454
|
+
*
|
|
6455
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6456
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6457
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6458
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6459
|
+
* heuristic put it in.
|
|
6460
|
+
*/
|
|
6461
|
+
profileHint: CamProfileSchema.optional(),
|
|
6462
|
+
/**
|
|
6448
6463
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6449
6464
|
* the source reader without inspecting it. Currently used by
|
|
6450
6465
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7894,7 +7909,22 @@ var RecordingTriggersSchema = object({
|
|
|
7894
7909
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7895
7910
|
* registrare.
|
|
7896
7911
|
*/
|
|
7897
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7912
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7913
|
+
/**
|
|
7914
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7915
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7916
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7917
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7918
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7919
|
+
*
|
|
7920
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7921
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7922
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7923
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7924
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7925
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7926
|
+
*/
|
|
7927
|
+
deviceSignal: boolean().optional()
|
|
7898
7928
|
});
|
|
7899
7929
|
/**
|
|
7900
7930
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11358,6 +11388,8 @@ method(object({
|
|
|
11358
11388
|
label: string().optional(),
|
|
11359
11389
|
deviceFeatures: array(string()).optional(),
|
|
11360
11390
|
autoEligible: boolean().optional(),
|
|
11391
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11392
|
+
profileHint: CamProfileSchema.optional(),
|
|
11361
11393
|
metadata: record(string(), unknown()).optional(),
|
|
11362
11394
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11363
11395
|
* derived broker reads its encoded plane from.
|
|
@@ -29900,6 +29932,77 @@ method(object({
|
|
|
29900
29932
|
auth: "protected"
|
|
29901
29933
|
});
|
|
29902
29934
|
/**
|
|
29935
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
29936
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
29937
|
+
* running, a gate open) and lowers when it stops.
|
|
29938
|
+
*
|
|
29939
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
29940
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
29941
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
29942
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
29943
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
29944
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
29945
|
+
* which records the dock for that long after every short one. So the recorder
|
|
29946
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
29947
|
+
* own post-buffer once it falls.
|
|
29948
|
+
*
|
|
29949
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
29950
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
29951
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
29952
|
+
* `DeviceStateChanged` for it and read it back through
|
|
29953
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
29954
|
+
* against the device (D224, D8/D11).
|
|
29955
|
+
*
|
|
29956
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
29957
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
29958
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
29959
|
+
* about the camera, on the camera.
|
|
29960
|
+
*/
|
|
29961
|
+
var RecordingSignalStatusSchema = object({
|
|
29962
|
+
/** True while the device asks to be recorded. */
|
|
29963
|
+
active: boolean(),
|
|
29964
|
+
/**
|
|
29965
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
29966
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
29967
|
+
* branches on it.
|
|
29968
|
+
*/
|
|
29969
|
+
reason: string(),
|
|
29970
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
29971
|
+
lastChangedAt: number()
|
|
29972
|
+
});
|
|
29973
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
29974
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
29975
|
+
var recordingSignalCapability = {
|
|
29976
|
+
name: "recording-signal",
|
|
29977
|
+
scope: "device",
|
|
29978
|
+
deviceNative: true,
|
|
29979
|
+
mode: "singleton",
|
|
29980
|
+
deviceTypes: [DeviceType.Camera],
|
|
29981
|
+
methods: {
|
|
29982
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
29983
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
29984
|
+
status: {
|
|
29985
|
+
schema: RecordingSignalStatusSchema,
|
|
29986
|
+
kind: "push",
|
|
29987
|
+
empty: {
|
|
29988
|
+
active: false,
|
|
29989
|
+
reason: "unknown",
|
|
29990
|
+
lastChangedAt: 0
|
|
29991
|
+
}
|
|
29992
|
+
},
|
|
29993
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
29994
|
+
/**
|
|
29995
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
29996
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
29997
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
29998
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
29999
|
+
*
|
|
30000
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30001
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30002
|
+
*/
|
|
30003
|
+
durability: "session"
|
|
30004
|
+
};
|
|
30005
|
+
/**
|
|
29903
30006
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
29904
30007
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
29905
30008
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30397,6 +30500,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30397
30500
|
deviceFeatures: array(string()).optional(),
|
|
30398
30501
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30399
30502
|
autoEligible: boolean().optional(),
|
|
30503
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30504
|
+
profileHint: CamProfileSchema.optional(),
|
|
30400
30505
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30401
30506
|
metadata: record(string(), unknown()).optional()
|
|
30402
30507
|
});
|
|
@@ -32536,6 +32641,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32536
32641
|
pressureSensor: pressureSensorCapability,
|
|
32537
32642
|
privacyMask: privacyMaskCapability,
|
|
32538
32643
|
ptzAutotrack: ptzAutotrackCapability,
|
|
32644
|
+
recordingSignal: recordingSignalCapability,
|
|
32539
32645
|
sceneMonitor: sceneMonitorCapability,
|
|
32540
32646
|
scriptRunner: scriptRunnerCapability,
|
|
32541
32647
|
smoke: smokeCapability,
|
|
@@ -33379,6 +33485,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33379
33485
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33380
33486
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33381
33487
|
}
|
|
33488
|
+
/**
|
|
33489
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33490
|
+
* device — quarantine it instead of dialling it.
|
|
33491
|
+
*
|
|
33492
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33493
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33494
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33495
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33496
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33497
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33498
|
+
*
|
|
33499
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33500
|
+
* once, with its `deviceId`, and set aside.
|
|
33501
|
+
*
|
|
33502
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33503
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33504
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33505
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33506
|
+
*/
|
|
33507
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33508
|
+
isUnrestorableShell(saved) {
|
|
33509
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33510
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33511
|
+
const config = saved.config;
|
|
33512
|
+
if (config === void 0) return false;
|
|
33513
|
+
return Object.keys(config).length === 0;
|
|
33514
|
+
}
|
|
33515
|
+
quarantineShell(saved) {
|
|
33516
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33517
|
+
deviceId: saved.id,
|
|
33518
|
+
stableId: saved.stableId,
|
|
33519
|
+
type: saved.type,
|
|
33520
|
+
attempts: 0,
|
|
33521
|
+
lastError: "persisted row has no configuration",
|
|
33522
|
+
failedAt: Date.now()
|
|
33523
|
+
});
|
|
33524
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33525
|
+
tags: {
|
|
33526
|
+
deviceId: saved.id,
|
|
33527
|
+
stableId: saved.stableId
|
|
33528
|
+
},
|
|
33529
|
+
meta: {
|
|
33530
|
+
type: saved.type,
|
|
33531
|
+
provider: this.providerName
|
|
33532
|
+
}
|
|
33533
|
+
});
|
|
33534
|
+
}
|
|
33382
33535
|
cancelRestoreRetries() {
|
|
33383
33536
|
this._restoreRetryScheduler?.cancel();
|
|
33384
33537
|
this._restoreRetryScheduler = null;
|
|
@@ -33563,6 +33716,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33563
33716
|
});
|
|
33564
33717
|
return;
|
|
33565
33718
|
}
|
|
33719
|
+
if (this.isUnrestorableShell(saved)) {
|
|
33720
|
+
this.quarantineShell(saved);
|
|
33721
|
+
return;
|
|
33722
|
+
}
|
|
33566
33723
|
try {
|
|
33567
33724
|
await attemptRestore(saved);
|
|
33568
33725
|
} catch (err) {
|
|
@@ -38283,6 +38440,12 @@ Object.freeze({
|
|
|
38283
38440
|
addonId: null,
|
|
38284
38441
|
access: "view"
|
|
38285
38442
|
},
|
|
38443
|
+
"recordingSignal.getStatus": {
|
|
38444
|
+
capName: "recording-signal",
|
|
38445
|
+
capScope: "device",
|
|
38446
|
+
addonId: null,
|
|
38447
|
+
access: "view"
|
|
38448
|
+
},
|
|
38286
38449
|
"sceneMonitor.captureReference": {
|
|
38287
38450
|
capName: "scene-monitor",
|
|
38288
38451
|
capScope: "device",
|
|
@@ -41275,6 +41438,11 @@ Object.freeze({
|
|
|
41275
41438
|
form: "single",
|
|
41276
41439
|
optional: true
|
|
41277
41440
|
}],
|
|
41441
|
+
"recordingSignal.getStatus": [{
|
|
41442
|
+
name: "deviceId",
|
|
41443
|
+
form: "single",
|
|
41444
|
+
optional: false
|
|
41445
|
+
}],
|
|
41278
41446
|
"sceneMonitor.captureReference": [{
|
|
41279
41447
|
name: "deviceId",
|
|
41280
41448
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -6444,6 +6444,21 @@ var CameraStreamSchema = object({
|
|
|
6444
6444
|
*/
|
|
6445
6445
|
autoEligible: boolean().optional(),
|
|
6446
6446
|
/**
|
|
6447
|
+
* The profile slot the PUBLISHER says this stream is: `low` for a stream
|
|
6448
|
+
* whose only sensible role is the low-bandwidth one, `high` for a main
|
|
6449
|
+
* stream. Consulted by the broker's automatic ranking
|
|
6450
|
+
* (`rankInitialAssignment`) BEFORE the pixel-count heuristic, and only there:
|
|
6451
|
+
* an operator's manual assignment still wins, and an absent hint is the
|
|
6452
|
+
* pixel-ranked default every camera had before this field existed.
|
|
6453
|
+
*
|
|
6454
|
+
* Why it exists: a camera with ONE stream ranked to `mid` — the slot no
|
|
6455
|
+
* storage class is written for on its own (`recordings` is high|mid,
|
|
6456
|
+
* `recordingsLow` is low) and the one profile scrub does not read. The robot
|
|
6457
|
+
* camera's single 720p relay is a `low` in every respect except the slot the
|
|
6458
|
+
* heuristic put it in.
|
|
6459
|
+
*/
|
|
6460
|
+
profileHint: CamProfileSchema.optional(),
|
|
6461
|
+
/**
|
|
6447
6462
|
* Transport-specific opaque metadata. The broker passes it through to
|
|
6448
6463
|
* the source reader without inspecting it. Currently used by
|
|
6449
6464
|
* `pull-rfc4571` streams to carry the upstream SDP (so the reader can
|
|
@@ -7893,7 +7908,22 @@ var RecordingTriggersSchema = object({
|
|
|
7893
7908
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7894
7909
|
* registrare.
|
|
7895
7910
|
*/
|
|
7896
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7911
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
|
|
7912
|
+
/**
|
|
7913
|
+
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7914
|
+
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7915
|
+
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7916
|
+
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7917
|
+
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7918
|
+
*
|
|
7919
|
+
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7920
|
+
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7921
|
+
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7922
|
+
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7923
|
+
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7924
|
+
* (`holdTrigger` / `releaseTrigger`).
|
|
7925
|
+
*/
|
|
7926
|
+
deviceSignal: boolean().optional()
|
|
7897
7927
|
});
|
|
7898
7928
|
/**
|
|
7899
7929
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -11357,6 +11387,8 @@ method(object({
|
|
|
11357
11387
|
label: string().optional(),
|
|
11358
11388
|
deviceFeatures: array(string()).optional(),
|
|
11359
11389
|
autoEligible: boolean().optional(),
|
|
11390
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
11391
|
+
profileHint: CamProfileSchema.optional(),
|
|
11360
11392
|
metadata: record(string(), unknown()).optional(),
|
|
11361
11393
|
/** Required when kind === 'derived' — the source camStreamId the
|
|
11362
11394
|
* derived broker reads its encoded plane from.
|
|
@@ -29899,6 +29931,77 @@ method(object({
|
|
|
29899
29931
|
auth: "protected"
|
|
29900
29932
|
});
|
|
29901
29933
|
/**
|
|
29934
|
+
* A camera's own "record me NOW" LEVEL — a signal the device raises while
|
|
29935
|
+
* something it knows about is happening (a robot vacuum cleaning, a machine
|
|
29936
|
+
* running, a gate open) and lowers when it stops.
|
|
29937
|
+
*
|
|
29938
|
+
* It is a level, not an edge. The sensor triggers the recorder already listens
|
|
29939
|
+
* to (`SOURCE_CAP_ACTIVE_FIELD`) fire on a rising edge and record for a fixed
|
|
29940
|
+
* post-buffer; a cleaning lasts forty minutes, and forty minutes of "this is
|
|
29941
|
+
* still happening" cannot be expressed as an edge plus a post-buffer without
|
|
29942
|
+
* either re-triggering on a timer (polling — D224 forbids the consumer keeping
|
|
29943
|
+
* the fact fresh) or picking a post-buffer long enough to cover every job,
|
|
29944
|
+
* which records the dock for that long after every short one. So the recorder
|
|
29945
|
+
* reads the LEVEL: it records for as long as `active` is true, plus the band's
|
|
29946
|
+
* own post-buffer once it falls.
|
|
29947
|
+
*
|
|
29948
|
+
* Who owns the fact: the PROVIDER of the device, which already reads the state
|
|
29949
|
+
* the signal is derived from (the vacuum's lifecycle state, for Dreame). It
|
|
29950
|
+
* writes this slice on every change; consumers subscribe to the kernel's
|
|
29951
|
+
* `DeviceStateChanged` for it and read it back through
|
|
29952
|
+
* `deviceState.getCapSlice` to reconcile — never a second copy, never a poll
|
|
29953
|
+
* against the device (D224, D8/D11).
|
|
29954
|
+
*
|
|
29955
|
+
* Deliberately NOT a `binary` sensor on the camera: a binary sensor is exported
|
|
29956
|
+
* to Home Assistant, HomeKit and the sensor picker as a thing an operator can
|
|
29957
|
+
* bind, and "the camera wants to record" is not a room sensor. It is a fact
|
|
29958
|
+
* about the camera, on the camera.
|
|
29959
|
+
*/
|
|
29960
|
+
var RecordingSignalStatusSchema = object({
|
|
29961
|
+
/** True while the device asks to be recorded. */
|
|
29962
|
+
active: boolean(),
|
|
29963
|
+
/**
|
|
29964
|
+
* Why, in the provider's own vocabulary (a vacuum's `cleaning` / `docked`,
|
|
29965
|
+
* …). Free text for the log line and the UI badge; the recorder never
|
|
29966
|
+
* branches on it.
|
|
29967
|
+
*/
|
|
29968
|
+
reason: string(),
|
|
29969
|
+
/** Ms epoch of the last `active` transition. 0 if never observed. */
|
|
29970
|
+
lastChangedAt: number()
|
|
29971
|
+
});
|
|
29972
|
+
/** The runtime-state slice: the status plus the clock every slice carries. */
|
|
29973
|
+
var RecordingSignalRuntimeStateSchema = RecordingSignalStatusSchema.extend({ lastFetchedAt: number() });
|
|
29974
|
+
var recordingSignalCapability = {
|
|
29975
|
+
name: "recording-signal",
|
|
29976
|
+
scope: "device",
|
|
29977
|
+
deviceNative: true,
|
|
29978
|
+
mode: "singleton",
|
|
29979
|
+
deviceTypes: [DeviceType.Camera],
|
|
29980
|
+
methods: {
|
|
29981
|
+
/** The current level, straight from the slice the provider keeps fresh. */
|
|
29982
|
+
getStatus: method(object({ deviceId: number() }), RecordingSignalStatusSchema) },
|
|
29983
|
+
status: {
|
|
29984
|
+
schema: RecordingSignalStatusSchema,
|
|
29985
|
+
kind: "push",
|
|
29986
|
+
empty: {
|
|
29987
|
+
active: false,
|
|
29988
|
+
reason: "unknown",
|
|
29989
|
+
lastChangedAt: 0
|
|
29990
|
+
}
|
|
29991
|
+
},
|
|
29992
|
+
runtimeState: RecordingSignalRuntimeStateSchema,
|
|
29993
|
+
/**
|
|
29994
|
+
* Runtime-state durability: **session** — a restored `active: true` from
|
|
29995
|
+
* before a restart is exactly the stale level the recorder's reconcile bound
|
|
29996
|
+
* exists to end, and the provider re-derives the true level on activation
|
|
29997
|
+
* anyway. Nothing is lost by forgetting it; a lie is avoided.
|
|
29998
|
+
*
|
|
29999
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30000
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30001
|
+
*/
|
|
30002
|
+
durability: "session"
|
|
30003
|
+
};
|
|
30004
|
+
/**
|
|
29902
30005
|
* scene-monitor — device-scoped reference-region state cap. An operator marks
|
|
29903
30006
|
* a rect ROI on a camera frame and names one or more states; the engine
|
|
29904
30007
|
* (pipeline-analytics, designated post-processing node) reports which state is
|
|
@@ -30396,6 +30499,8 @@ var CamStreamDescriptorSchema = object({
|
|
|
30396
30499
|
deviceFeatures: array(string()).optional(),
|
|
30397
30500
|
/** Eligible for automatic profile assignment. Absent = `true`. */
|
|
30398
30501
|
autoEligible: boolean().optional(),
|
|
30502
|
+
/** The slot the publisher says this stream IS — see `CameraStreamSchema.profileHint`. */
|
|
30503
|
+
profileHint: CamProfileSchema.optional(),
|
|
30399
30504
|
/** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
|
|
30400
30505
|
metadata: record(string(), unknown()).optional()
|
|
30401
30506
|
});
|
|
@@ -32535,6 +32640,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32535
32640
|
pressureSensor: pressureSensorCapability,
|
|
32536
32641
|
privacyMask: privacyMaskCapability,
|
|
32537
32642
|
ptzAutotrack: ptzAutotrackCapability,
|
|
32643
|
+
recordingSignal: recordingSignalCapability,
|
|
32538
32644
|
sceneMonitor: sceneMonitorCapability,
|
|
32539
32645
|
scriptRunner: scriptRunnerCapability,
|
|
32540
32646
|
smoke: smokeCapability,
|
|
@@ -33378,6 +33484,53 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33378
33484
|
const ids = [...this._permanentRestoreFailures.keys()].join(", ");
|
|
33379
33485
|
return `${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${ids}) — restart the ${this.providerName} provider to retry`;
|
|
33380
33486
|
}
|
|
33487
|
+
/**
|
|
33488
|
+
* A top-level persisted row with NO configuration is a leftover, not a
|
|
33489
|
+
* device — quarantine it instead of dialling it.
|
|
33490
|
+
*
|
|
33491
|
+
* Device 614 was deleted, resurrected as a config-less shell by a write
|
|
33492
|
+
* already in flight (D376), and then dialled at every single boot: eight
|
|
33493
|
+
* `Failed to restore device — bounded retry scheduled` lines in one day,
|
|
33494
|
+
* each one the same Zod refusal on `host` and `password`. The bound was
|
|
33495
|
+
* real, but it is a bound PER PROCESS, and the runner restarts — so nothing
|
|
33496
|
+
* about the row ever stopped costing attempts and log lines.
|
|
33497
|
+
*
|
|
33498
|
+
* No retry can add a configuration that is not there. The row is reported
|
|
33499
|
+
* once, with its `deviceId`, and set aside.
|
|
33500
|
+
*
|
|
33501
|
+
* Top-level only: an accessory child legitimately carries an empty blob (it
|
|
33502
|
+
* lives off its parent), and a hub-adopted child with an emptied blob is
|
|
33503
|
+
* repaired by `healSavedConfig` from its parent instead. Providers that
|
|
33504
|
+
* genuinely create configuration-free top-level devices turn this off.
|
|
33505
|
+
*/
|
|
33506
|
+
quarantineConfiglessTopLevelRestores = true;
|
|
33507
|
+
isUnrestorableShell(saved) {
|
|
33508
|
+
if (!this.quarantineConfiglessTopLevelRestores) return false;
|
|
33509
|
+
if (saved.parentDeviceId !== null) return false;
|
|
33510
|
+
const config = saved.config;
|
|
33511
|
+
if (config === void 0) return false;
|
|
33512
|
+
return Object.keys(config).length === 0;
|
|
33513
|
+
}
|
|
33514
|
+
quarantineShell(saved) {
|
|
33515
|
+
this._permanentRestoreFailures.set(saved.id, {
|
|
33516
|
+
deviceId: saved.id,
|
|
33517
|
+
stableId: saved.stableId,
|
|
33518
|
+
type: saved.type,
|
|
33519
|
+
attempts: 0,
|
|
33520
|
+
lastError: "persisted row has no configuration",
|
|
33521
|
+
failedAt: Date.now()
|
|
33522
|
+
});
|
|
33523
|
+
this.ctx.logger.error("Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.", {
|
|
33524
|
+
tags: {
|
|
33525
|
+
deviceId: saved.id,
|
|
33526
|
+
stableId: saved.stableId
|
|
33527
|
+
},
|
|
33528
|
+
meta: {
|
|
33529
|
+
type: saved.type,
|
|
33530
|
+
provider: this.providerName
|
|
33531
|
+
}
|
|
33532
|
+
});
|
|
33533
|
+
}
|
|
33381
33534
|
cancelRestoreRetries() {
|
|
33382
33535
|
this._restoreRetryScheduler?.cancel();
|
|
33383
33536
|
this._restoreRetryScheduler = null;
|
|
@@ -33562,6 +33715,10 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33562
33715
|
});
|
|
33563
33716
|
return;
|
|
33564
33717
|
}
|
|
33718
|
+
if (this.isUnrestorableShell(saved)) {
|
|
33719
|
+
this.quarantineShell(saved);
|
|
33720
|
+
return;
|
|
33721
|
+
}
|
|
33565
33722
|
try {
|
|
33566
33723
|
await attemptRestore(saved);
|
|
33567
33724
|
} catch (err) {
|
|
@@ -38282,6 +38439,12 @@ Object.freeze({
|
|
|
38282
38439
|
addonId: null,
|
|
38283
38440
|
access: "view"
|
|
38284
38441
|
},
|
|
38442
|
+
"recordingSignal.getStatus": {
|
|
38443
|
+
capName: "recording-signal",
|
|
38444
|
+
capScope: "device",
|
|
38445
|
+
addonId: null,
|
|
38446
|
+
access: "view"
|
|
38447
|
+
},
|
|
38285
38448
|
"sceneMonitor.captureReference": {
|
|
38286
38449
|
capName: "scene-monitor",
|
|
38287
38450
|
capScope: "device",
|
|
@@ -41274,6 +41437,11 @@ Object.freeze({
|
|
|
41274
41437
|
form: "single",
|
|
41275
41438
|
optional: true
|
|
41276
41439
|
}],
|
|
41440
|
+
"recordingSignal.getStatus": [{
|
|
41441
|
+
name: "deviceId",
|
|
41442
|
+
form: "single",
|
|
41443
|
+
optional: false
|
|
41444
|
+
}],
|
|
41277
41445
|
"sceneMonitor.captureReference": [{
|
|
41278
41446
|
name: "deviceId",
|
|
41279
41447
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unifi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.74",
|
|
4
4
|
"description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|