@camstack/addon-export-hap 1.2.113 → 1.2.115
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/hap-export.addon.js +770 -67
- package/dist/hap-export.addon.mjs +770 -67
- package/package.json +1 -1
|
@@ -72,7 +72,7 @@ function carryForward(base, existing, keys) {
|
|
|
72
72
|
return out;
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region ../types/dist/event-category-
|
|
75
|
+
//#region ../types/dist/event-category-BVDXG4tB.mjs
|
|
76
76
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
77
77
|
EventCategory["SystemBoot"] = "system.boot";
|
|
78
78
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -689,6 +689,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
689
689
|
* pull-reconcile from the provider's `getStatus` on reconnect. */
|
|
690
690
|
EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
|
|
691
691
|
EventCategory["BackupCompleted"] = "backup.completed";
|
|
692
|
+
/**
|
|
693
|
+
* A whole backup RUN finished — every destination attempted, win or lose.
|
|
694
|
+
*
|
|
695
|
+
* `backup.completed` fires once per DESTINATION, which is the right grain for
|
|
696
|
+
* a progress UI and the wrong one for a notification: an operator with three
|
|
697
|
+
* destinations would be told three times. And a run where two of three
|
|
698
|
+
* destinations succeeded is not a clean success — a single "backup
|
|
699
|
+
* completed" that hid the failed one would be a lie, so the count of each is
|
|
700
|
+
* carried here and the message says both.
|
|
701
|
+
*
|
|
702
|
+
* Emitted by the backup orchestrator only after the destination loop, so a
|
|
703
|
+
* run that dies during the BUILD phase produces no completion at all.
|
|
704
|
+
*/
|
|
705
|
+
EventCategory["BackupRunCompleted"] = "backup.run-completed";
|
|
692
706
|
EventCategory["BackupRestored"] = "backup.restored";
|
|
693
707
|
EventCategory["NotificationDispatched"] = "notification.dispatched";
|
|
694
708
|
EventCategory["NotificationFailed"] = "notification.failed";
|
|
@@ -5419,7 +5433,7 @@ var ZodIssueCode = {
|
|
|
5419
5433
|
var ZodFirstPartyTypeKind;
|
|
5420
5434
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5421
5435
|
//#endregion
|
|
5422
|
-
//#region ../types/dist/sleep-
|
|
5436
|
+
//#region ../types/dist/sleep-BDR76Ykr.mjs
|
|
5423
5437
|
/**
|
|
5424
5438
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5425
5439
|
* window to float samples (D455).
|
|
@@ -8047,6 +8061,28 @@ var EncodeProfileSchema = object({
|
|
|
8047
8061
|
outputArgs: array(string()).optional()
|
|
8048
8062
|
});
|
|
8049
8063
|
/**
|
|
8064
|
+
* THE target rule: which of two sizes serves a consumer better.
|
|
8065
|
+
*
|
|
8066
|
+
* "Prefer at or above the target so the consumer downscales instead of
|
|
8067
|
+
* upscaling; among those the SMALLEST, because the extra pixels are thrown
|
|
8068
|
+
* away and the decode is not; among the rest the LARGEST, because it is the
|
|
8069
|
+
* closest we can get." One sentence, and until now it was written twice — once
|
|
8070
|
+
* here in lines, once in `stream-selection.ts` in pixels, for the same two
|
|
8071
|
+
* exporters. The two agreed, which is luck, not a property.
|
|
8072
|
+
*
|
|
8073
|
+
* The `size` is whatever measure the caller ranks by: the cap ranks by LINES
|
|
8074
|
+
* (a consumer's requirement is stated in p), the RTSP picker by PIXELS (it
|
|
8075
|
+
* compares entries of possibly different aspect). The rule is the same either
|
|
8076
|
+
* way and the measure is the caller's business.
|
|
8077
|
+
*
|
|
8078
|
+
* Returns a sort delta: negative when `a` should come first.
|
|
8079
|
+
*/
|
|
8080
|
+
function compareToTarget(a, b, target) {
|
|
8081
|
+
const aReaches = a >= target;
|
|
8082
|
+
if (aReaches !== b >= target) return aReaches ? -1 : 1;
|
|
8083
|
+
return aReaches ? a - b : b - a;
|
|
8084
|
+
}
|
|
8085
|
+
/**
|
|
8050
8086
|
* The shape every live egress starts from: H.264 Baseline 3.1 at 720p25.
|
|
8051
8087
|
* Baseline because it is the one profile every consumer in this repo decodes
|
|
8052
8088
|
* (Echo, iOS, an old browser); 3.1 because that is what the SDPs advertise.
|
|
@@ -9959,6 +9995,47 @@ var LogChannelWindowSchema = object({
|
|
|
9959
9995
|
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9960
9996
|
deviceIds: array(number().int()).readonly().nullable()
|
|
9961
9997
|
});
|
|
9998
|
+
/**
|
|
9999
|
+
* Shared stream-selection picker for export addons.
|
|
10000
|
+
*
|
|
10001
|
+
* Both `addon-export-alexa` and `addon-export-hap` resolve the
|
|
10002
|
+
* operator's `streamPreference` setting against the broker's RTSP
|
|
10003
|
+
* entries before dialling a camera. Each addon used to roll its own:
|
|
10004
|
+
* Alexa had `pickPreferredRtspEntry` under `handlers/`, HAP had an
|
|
10005
|
+
* inline `"prefer /mid, then /high, then first"` chain inside its
|
|
10006
|
+
* camera-streams mapper. The chains drifted (Alexa honoured
|
|
10007
|
+
* `streamPreference`, HAP didn't; only Alexa got the smart
|
|
10008
|
+
* resolution-targeted auto-pick) and the cross-addon import rule
|
|
10009
|
+
* blocks deduping in either direction.
|
|
10010
|
+
*
|
|
10011
|
+
* Lifting the picker into `@camstack/types` lets every exporter call
|
|
10012
|
+
* the same code path with the consumer's target resolution baked into
|
|
10013
|
+
* the call site — Alexa passes 1280×720, HomeKit passes 1920×1080,
|
|
10014
|
+
* the picker handles the rest.
|
|
10015
|
+
*
|
|
10016
|
+
* Selection algorithm:
|
|
10017
|
+
* - pref === '<profile>' → profile-keyed entries (from
|
|
10018
|
+
* `getProfileRtspEntries`) match on `e.profile`;
|
|
10019
|
+
* legacy raw entries match on the brokerId
|
|
10020
|
+
* suffix (`brokerId` ENDS WITH `/${pref}`, shape
|
|
10021
|
+
* `${deviceId}/${camStreamId}`). Addons store the
|
|
10022
|
+
* bare profile/camStream id in their
|
|
10023
|
+
* `ExportDeviceSettings.streamPreference`. Falls
|
|
10024
|
+
* back to 'auto' when no enabled entry matches
|
|
10025
|
+
* either way.
|
|
10026
|
+
* - pref === 'auto' → when `targetResolution` is given, pick the
|
|
10027
|
+
* entry whose source resolution is closest to
|
|
10028
|
+
* it (prefer ≥ target so the consumer
|
|
10029
|
+
* downscales instead of upscaling). Without a
|
|
10030
|
+
* target, fall back to first-enabled. If no
|
|
10031
|
+
* entry advertises a resolution at all
|
|
10032
|
+
* (broker hasn't probed yet), also fall back
|
|
10033
|
+
* to first-enabled so cold start still serves.
|
|
10034
|
+
*
|
|
10035
|
+
* Returns `null` when nothing is publishable — callers fold that into
|
|
10036
|
+
* the consumer's "no stream" error (Alexa: STREAM_TYPE_UNSUPPORTED;
|
|
10037
|
+
* HAP: a thrown error inside `startFfmpegForSession`).
|
|
10038
|
+
*/
|
|
9962
10039
|
function pickPreferredRtspEntry(entries, pref, deviceId, options = {}) {
|
|
9963
10040
|
if (entries.length === 0) return null;
|
|
9964
10041
|
const prefix = `${deviceId}/`;
|
|
@@ -9988,30 +10065,23 @@ function pickPreferredRtspEntry(entries, pref, deviceId, options = {}) {
|
|
|
9988
10065
|
return toPicked(eligible[0]);
|
|
9989
10066
|
}
|
|
9990
10067
|
/**
|
|
9991
|
-
* Pick the entry whose `resolution` is closest to `target
|
|
9992
|
-
*
|
|
9993
|
-
*
|
|
9994
|
-
*
|
|
9995
|
-
*
|
|
10068
|
+
* Pick the entry whose `resolution` is closest to `target`, by the ONE target
|
|
10069
|
+
* rule ({@link compareToTarget}): prefer at or above the target so the consumer
|
|
10070
|
+
* downscales instead of upscaling; among those the smallest; among the rest the
|
|
10071
|
+
* largest.
|
|
10072
|
+
*
|
|
10073
|
+
* This function used to implement that rule itself, in pixels, while
|
|
10074
|
+
* `rankStreams` implemented it again in lines — the same sentence written twice
|
|
10075
|
+
* for the same two exporters, agreeing by luck rather than by construction.
|
|
10076
|
+
* Only the MEASURE is this picker's own: it compares whole pixel counts because
|
|
10077
|
+
* its entries can differ in aspect, where the cap's requirement is stated in p.
|
|
9996
10078
|
*/
|
|
9997
10079
|
function pickClosestResolution(entries, target) {
|
|
9998
10080
|
const targetPixels = target.width * target.height;
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
const pixels = e.resolution.width * e.resolution.height;
|
|
10004
|
-
if (pixels >= targetPixels) {
|
|
10005
|
-
if (!bestAbove || pixels < bestAbove.pixels) bestAbove = {
|
|
10006
|
-
entry: e,
|
|
10007
|
-
pixels
|
|
10008
|
-
};
|
|
10009
|
-
} else if (!bestBelow || pixels > bestBelow.pixels) bestBelow = {
|
|
10010
|
-
entry: e,
|
|
10011
|
-
pixels
|
|
10012
|
-
};
|
|
10013
|
-
}
|
|
10014
|
-
return bestAbove?.entry ?? bestBelow?.entry;
|
|
10081
|
+
return [...entries.flatMap((entry) => entry.resolution === void 0 ? [] : [{
|
|
10082
|
+
entry,
|
|
10083
|
+
pixels: entry.resolution.width * entry.resolution.height
|
|
10084
|
+
}])].sort((a, b) => compareToTarget(a.pixels, b.pixels, targetPixels))[0]?.entry;
|
|
10015
10085
|
}
|
|
10016
10086
|
var MODEL_FORMATS = [
|
|
10017
10087
|
"onnx",
|
|
@@ -12199,6 +12269,58 @@ method(ListInputSchema, array(BrokerInfoSchema$1)), method(GetInputSchema, Broke
|
|
|
12199
12269
|
auth: "admin"
|
|
12200
12270
|
}), method(GetStateInputSchema, unknown().nullable()), method(_void(), RegistryStatusSchema);
|
|
12201
12271
|
DeviceType.Camera;
|
|
12272
|
+
/**
|
|
12273
|
+
* The signals a device can emit to WAKE its own stream.
|
|
12274
|
+
*
|
|
12275
|
+
* A camera whose stream is built on demand sleeps until something asks for it,
|
|
12276
|
+
* and "something" cannot be a consumer that is merely attached — a Frigate-style
|
|
12277
|
+
* puller holds a session open for ever, and treating that as demand would keep
|
|
12278
|
+
* a battery camera awake for ever, which is the whole thing the battery is for
|
|
12279
|
+
* (D173). So the wake has to come from the CAMERA: an event it noticed by
|
|
12280
|
+
* itself, with no stream running.
|
|
12281
|
+
*
|
|
12282
|
+
* ## The vocabulary is the PROVIDER'S, not ours
|
|
12283
|
+
*
|
|
12284
|
+
* Like `consumables`, this cap declares no vocabulary of its own. A provider
|
|
12285
|
+
* names each signal with a `code` it chooses and a `label` an operator reads.
|
|
12286
|
+
* Reolink offers motion and camera-native detection; another provider may offer
|
|
12287
|
+
* a tamper, a doorbell press, a PIR, or something no camera in this fleet has
|
|
12288
|
+
* yet. A fixed enum here would mean every new signal is a framework release.
|
|
12289
|
+
*
|
|
12290
|
+
* It is deliberately NOT derived from the caps a device already binds. Whether
|
|
12291
|
+
* a camera CAN push firmware motion is expressed by `motionSources` containing
|
|
12292
|
+
* `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
|
|
12293
|
+
* binding — but both answer "what drives the detection pipeline", which is a
|
|
12294
|
+
* different question from "what may wake a sleeping stream". A camera can do
|
|
12295
|
+
* the first and not be trusted with the second, and the operator picks per
|
|
12296
|
+
* camera. Two questions, two authorities.
|
|
12297
|
+
*
|
|
12298
|
+
* ## Availability is not permission
|
|
12299
|
+
*
|
|
12300
|
+
* `listSignals` says what the device CAN emit. Whether a given signal actually
|
|
12301
|
+
* wakes the stream is the operator's per-camera choice, held by the broker
|
|
12302
|
+
* alongside the cooldown — see the stream-broker cap's wake settings. A
|
|
12303
|
+
* provider declaring a signal is not a provider enabling it.
|
|
12304
|
+
*/
|
|
12305
|
+
/** One signal a device can emit. */
|
|
12306
|
+
var StreamSignalSchema = object({
|
|
12307
|
+
/** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
|
|
12308
|
+
code: string().min(1),
|
|
12309
|
+
/** What an operator reads in the picker. The provider's own wording. */
|
|
12310
|
+
label: string().min(1),
|
|
12311
|
+
/**
|
|
12312
|
+
* Whether the provider recommends this signal ON when a camera is first set
|
|
12313
|
+
* up. A provider knows which of its signals are cheap and reliable; an
|
|
12314
|
+
* operator should not have to discover that by trial. Reolink recommends
|
|
12315
|
+
* both of its own.
|
|
12316
|
+
*/
|
|
12317
|
+
recommended: boolean()
|
|
12318
|
+
});
|
|
12319
|
+
object({
|
|
12320
|
+
signals: array(StreamSignalSchema),
|
|
12321
|
+
lastFetchedAt: number()
|
|
12322
|
+
});
|
|
12323
|
+
Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
|
|
12202
12324
|
/** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
|
|
12203
12325
|
var StreamFormatSchema = _enum([
|
|
12204
12326
|
"webrtc",
|
|
@@ -12595,6 +12717,22 @@ var EgressTranscodeSchema = object({
|
|
|
12595
12717
|
camStreamId: string().nullable()
|
|
12596
12718
|
});
|
|
12597
12719
|
method(object({
|
|
12720
|
+
deviceId: number().int().nonnegative(),
|
|
12721
|
+
/** The provider's signal code. */
|
|
12722
|
+
code: string().min(1),
|
|
12723
|
+
/** Ms epoch. Absent ⇒ now. */
|
|
12724
|
+
at: number().optional()
|
|
12725
|
+
}), object({
|
|
12726
|
+
/** Whether the broker acted on it, and if not, why. */
|
|
12727
|
+
accepted: boolean(),
|
|
12728
|
+
reason: _enum([
|
|
12729
|
+
"woke",
|
|
12730
|
+
"hold-extended",
|
|
12731
|
+
"not-enabled",
|
|
12732
|
+
"no-consumer",
|
|
12733
|
+
"unknown-code"
|
|
12734
|
+
])
|
|
12735
|
+
}), { kind: "mutation" }), method(object({
|
|
12598
12736
|
deviceId: number().int().nonnegative(),
|
|
12599
12737
|
camStreamId: string().min(1),
|
|
12600
12738
|
kind: CamStreamKindSchema,
|
|
@@ -12849,6 +12987,16 @@ var PickStreamRequirementsSchema = object({
|
|
|
12849
12987
|
acceptCodecs: array(StreamCodecSchema).readonly().optional(),
|
|
12850
12988
|
/** Minimum vertical resolution. Streams shorter than this are dropped. */
|
|
12851
12989
|
minHeight: number().int().positive().optional(),
|
|
12990
|
+
/**
|
|
12991
|
+
* Maximum vertical resolution. Streams TALLER than this are dropped.
|
|
12992
|
+
*
|
|
12993
|
+
* A consumer can have a ceiling as real as its floor: Alexa documents
|
|
12994
|
+
* 480p to 1080p, and a 4K stream is as unusable to an Echo as a 360p one.
|
|
12995
|
+
* Without this the ceiling had to be re-implemented by every caller — and
|
|
12996
|
+
* one caller implementing it privately is how a second scoring authority
|
|
12997
|
+
* gets born.
|
|
12998
|
+
*/
|
|
12999
|
+
maxHeight: number().int().positive().optional(),
|
|
12852
13000
|
/** Minimum horizontal resolution. */
|
|
12853
13001
|
minWidth: number().int().positive().optional(),
|
|
12854
13002
|
/**
|
|
@@ -12865,7 +13013,22 @@ var PickStreamRequirementsSchema = object({
|
|
|
12865
13013
|
* transcoded" guard: if the device is already serving the consumer's
|
|
12866
13014
|
* codec end-to-end, there's nothing to optimise.
|
|
12867
13015
|
*/
|
|
12868
|
-
requireSiblingCodec: array(StreamCodecSchema).readonly().optional()
|
|
13016
|
+
requireSiblingCodec: array(StreamCodecSchema).readonly().optional(),
|
|
13017
|
+
/**
|
|
13018
|
+
* Whether a stream the consumer CANNOT decode may still be picked, on the
|
|
13019
|
+
* understanding that it will be transcoded.
|
|
13020
|
+
*
|
|
13021
|
+
* Default `false` — today's behaviour, and the right one for a bypass
|
|
13022
|
+
* question ("is there a stream I can forward untouched?"). Set `true` to
|
|
13023
|
+
* ask the larger question: "what is the best stream for me, transcoding if
|
|
13024
|
+
* I must?" A stream that satisfies `acceptCodecs` always outranks one that
|
|
13025
|
+
* does not, so a passthrough is never lost to a transcode; the answer says
|
|
13026
|
+
* which it is in {@link PickedCamStreamSchema.transcodes}.
|
|
13027
|
+
*
|
|
13028
|
+
* This is what lets one picker serve both the bypass and the full source
|
|
13029
|
+
* choice, instead of a consumer scoring privately when the bypass misses.
|
|
13030
|
+
*/
|
|
13031
|
+
allowTranscode: boolean().optional()
|
|
12869
13032
|
}).readonly();
|
|
12870
13033
|
var PickStreamPreferencesSchema = object({
|
|
12871
13034
|
/**
|
|
@@ -12879,12 +13042,32 @@ var PickStreamPreferencesSchema = object({
|
|
|
12879
13042
|
* picks the tallest stream; `'lowest'` picks the shortest (used by
|
|
12880
13043
|
* memory-constrained consumers / Apple Home guest sessions).
|
|
12881
13044
|
*/
|
|
12882
|
-
resolutionPreference: _enum(["highest", "lowest"]).optional()
|
|
13045
|
+
resolutionPreference: _enum(["highest", "lowest"]).optional(),
|
|
13046
|
+
/**
|
|
13047
|
+
* The height the consumer actually wants to DELIVER.
|
|
13048
|
+
*
|
|
13049
|
+
* Not a constraint — an ordering. With it set, the SMALLEST stream at or
|
|
13050
|
+
* above the target wins, and only if nothing reaches it does the tallest
|
|
13051
|
+
* take over. Pulling 1296 lines to draw 720 on a 1280x800 Echo panel costs
|
|
13052
|
+
* a decode and buys nothing, and `resolutionPreference: 'highest'` cannot
|
|
13053
|
+
* express that: it says "as big as possible", which is a different wish.
|
|
13054
|
+
*
|
|
13055
|
+
* Ignored when absent, so every existing caller keeps its ordering.
|
|
13056
|
+
*/
|
|
13057
|
+
targetHeight: number().int().positive().optional()
|
|
12883
13058
|
}).readonly();
|
|
12884
13059
|
var PickedCamStreamSchema = object({
|
|
12885
13060
|
camStreamId: string(),
|
|
12886
13061
|
codec: string().optional(),
|
|
12887
13062
|
resolution: CamStreamResolutionSchema.optional(),
|
|
13063
|
+
/**
|
|
13064
|
+
* Whether serving this stream requires a decode + re-encode.
|
|
13065
|
+
*
|
|
13066
|
+
* `false` is a stream the consumer can take as it stands. Only ever `true`
|
|
13067
|
+
* when the caller asked for it with `allowTranscode`, so a caller that did
|
|
13068
|
+
* not ask cannot be handed a cost it never agreed to pay.
|
|
13069
|
+
*/
|
|
13070
|
+
transcodes: boolean(),
|
|
12888
13071
|
/** One-line explanation of why this stream won — for logs / debug UI. */
|
|
12889
13072
|
reason: string()
|
|
12890
13073
|
});
|
|
@@ -17154,6 +17337,8 @@ var NcSystemEventKindSchema = _enum([
|
|
|
17154
17337
|
"device-enabled",
|
|
17155
17338
|
"device-battery-low",
|
|
17156
17339
|
"device-battery-normal",
|
|
17340
|
+
"device-consumable-low",
|
|
17341
|
+
"device-consumable-normal",
|
|
17157
17342
|
"stream-online",
|
|
17158
17343
|
"stream-offline",
|
|
17159
17344
|
"node-online",
|
|
@@ -17172,6 +17357,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
17172
17357
|
"addon-updated",
|
|
17173
17358
|
"server-updated",
|
|
17174
17359
|
"export-completed",
|
|
17360
|
+
"backup-completed",
|
|
17175
17361
|
"camera-online",
|
|
17176
17362
|
"camera-offline",
|
|
17177
17363
|
"camera-disabled",
|
|
@@ -18494,6 +18680,48 @@ var NcAlarmConfigSchema = object({
|
|
|
18494
18680
|
settings: NcAlarmSettingsSchema,
|
|
18495
18681
|
coverage: array(NcAlarmModeCoverageSchema)
|
|
18496
18682
|
});
|
|
18683
|
+
/**
|
|
18684
|
+
* ONE rule's demand on ONE camera's clip ring.
|
|
18685
|
+
*
|
|
18686
|
+
* A rule, not a camera: the broker takes the MAX over the asks that reach a
|
|
18687
|
+
* camera, so the answer stays a faithful description of the rules and the
|
|
18688
|
+
* bounding (the byte budget, the broker's own ceiling) stays where the cost
|
|
18689
|
+
* lives. A camera that appears in no ask is being told **nothing** — which is
|
|
18690
|
+
* a different thing from never having been told, and only the envelope
|
|
18691
|
+
* (`rulesLoaded`) can tell those apart.
|
|
18692
|
+
*/
|
|
18693
|
+
var NcClipRetentionAskSchema = object({
|
|
18694
|
+
/**
|
|
18695
|
+
* The camera this ask is about. **Absent = every camera**, which is what a
|
|
18696
|
+
* rule with no `conditions.devices` means: it can fire anywhere, so it is
|
|
18697
|
+
* asking everywhere.
|
|
18698
|
+
*/
|
|
18699
|
+
deviceId: number().int().nonnegative().optional(),
|
|
18700
|
+
/** Seconds of history the rule needs held for it. Never zero — a rule that
|
|
18701
|
+
* needs nothing produces no ask at all. */
|
|
18702
|
+
seconds: number().min(0).max(60),
|
|
18703
|
+
/** The profile the rule cuts from, when it named one. Absent = the cheapest
|
|
18704
|
+
* assigned, which is what the cut defaults to. */
|
|
18705
|
+
profile: CamProfileSchema.optional(),
|
|
18706
|
+
/** Who is asking — so a retention the operator did not expect names a rule. */
|
|
18707
|
+
ruleId: string(),
|
|
18708
|
+
ruleName: string(),
|
|
18709
|
+
/** Why this many seconds: the rule's own window, or the occupancy ceiling. */
|
|
18710
|
+
reason: _enum(["window", "occupancy"])
|
|
18711
|
+
});
|
|
18712
|
+
/**
|
|
18713
|
+
* The whole answer, with the one bit that keeps absence from reading as zero.
|
|
18714
|
+
*
|
|
18715
|
+
* `rulesLoaded` is false until the rule ledger has completed a load at least
|
|
18716
|
+
* once. A centre that is up but has not read its rules yet answers with an
|
|
18717
|
+
* empty ask list that means nothing at all — applying it would drop every
|
|
18718
|
+
* camera's ring to zero for the first events after a restart, which is the
|
|
18719
|
+
* footage this mechanism exists to keep.
|
|
18720
|
+
*/
|
|
18721
|
+
var NcClipRetentionPlanSchema = object({
|
|
18722
|
+
rulesLoaded: boolean(),
|
|
18723
|
+
asks: array(NcClipRetentionAskSchema).readonly()
|
|
18724
|
+
});
|
|
18497
18725
|
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
18498
18726
|
kind: "mutation",
|
|
18499
18727
|
auth: "admin",
|
|
@@ -18514,7 +18742,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
18514
18742
|
}), object({ success: literal(true) }), {
|
|
18515
18743
|
kind: "mutation",
|
|
18516
18744
|
auth: "admin"
|
|
18517
|
-
}), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18745
|
+
}), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18518
18746
|
deviceId: number().int(),
|
|
18519
18747
|
muted: boolean()
|
|
18520
18748
|
}), object({ success: literal(true) }), {
|
|
@@ -21048,6 +21276,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
|
21048
21276
|
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
21049
21277
|
framesMatched: number().int()
|
|
21050
21278
|
})).readonly() });
|
|
21279
|
+
/**
|
|
21280
|
+
* The long-term series a camera produces. A closed union so a typo cannot
|
|
21281
|
+
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
21282
|
+
* is an alias of this, not a second list.
|
|
21283
|
+
*/
|
|
21284
|
+
var AnalyticsLtsSeriesSchema = _enum([
|
|
21285
|
+
"motion",
|
|
21286
|
+
"audio-dbfs",
|
|
21287
|
+
"battery",
|
|
21288
|
+
"occupancy"
|
|
21289
|
+
]);
|
|
21290
|
+
/**
|
|
21291
|
+
* One closed 5-minute bucket of a long-term series.
|
|
21292
|
+
*
|
|
21293
|
+
* `samples` is how many readings the bucket folded — it is the ACTIVITY for a
|
|
21294
|
+
* series like `motion`, and the confidence for one like `occupancy`. A bucket
|
|
21295
|
+
* that exists at all was measured; a bucket that is absent was not, which is a
|
|
21296
|
+
* different claim from zero and the reason this is a sparse series.
|
|
21297
|
+
*/
|
|
21298
|
+
var LtsBucketSchema = object({
|
|
21299
|
+
scope: string(),
|
|
21300
|
+
bucketStart: number().int(),
|
|
21301
|
+
samples: number().int().nonnegative(),
|
|
21302
|
+
sum: number(),
|
|
21303
|
+
min: number(),
|
|
21304
|
+
max: number()
|
|
21305
|
+
});
|
|
21051
21306
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
21052
21307
|
deviceId: number(),
|
|
21053
21308
|
trackId: string()
|
|
@@ -21094,6 +21349,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21094
21349
|
kinds: array(string()).optional(),
|
|
21095
21350
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
21096
21351
|
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
21352
|
+
deviceId: number(),
|
|
21353
|
+
series: AnalyticsLtsSeriesSchema,
|
|
21354
|
+
/** Omit for EVERY scope of this series in the range. */
|
|
21355
|
+
scope: string().optional(),
|
|
21356
|
+
from: number(),
|
|
21357
|
+
to: number(),
|
|
21358
|
+
limit: number().int().positive().optional()
|
|
21359
|
+
}), array(LtsBucketSchema).readonly()), method(object({
|
|
21097
21360
|
deviceId: number(),
|
|
21098
21361
|
since: number(),
|
|
21099
21362
|
until: number(),
|
|
@@ -21712,6 +21975,14 @@ var MotionSourceEnum = _enum([
|
|
|
21712
21975
|
*/
|
|
21713
21976
|
var MotionSourcesSchema = array(MotionSourceEnum);
|
|
21714
21977
|
/**
|
|
21978
|
+
* Which root detectors a camera runs. Deliberately the SAME vocabulary
|
|
21979
|
+
* post-analysis already tags every detection with (`DetectionSource`) rather
|
|
21980
|
+
* than a second spelling of the same two ideas — the value an operator picks
|
|
21981
|
+
* here is the value that comes back on the track, the overlay and the debug
|
|
21982
|
+
* row.
|
|
21983
|
+
*/
|
|
21984
|
+
var DetectionSourcesSchema = array(DetectionSourceSchema);
|
|
21985
|
+
/**
|
|
21715
21986
|
* Input shape for `pipeline-runner.reportMotion` cap method. Exported
|
|
21716
21987
|
* so cap-side consumers (the orchestrator forward, the runner addon's
|
|
21717
21988
|
* cap implementation, tests) can reuse the type instead of redeclaring
|
|
@@ -21862,6 +22133,35 @@ var RunnerCameraConfigSchema = object({
|
|
|
21862
22133
|
* events; the orchestrator forwards to `reportMotion`.
|
|
21863
22134
|
*/
|
|
21864
22135
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
22136
|
+
/**
|
|
22137
|
+
* WHICH root detector runs for this camera. The detection counterpart of
|
|
22138
|
+
* {@link motionSources}, same shape and same discipline: a per-camera list
|
|
22139
|
+
* of sources the system understands, vendor-agnostic, owned here.
|
|
22140
|
+
*
|
|
22141
|
+
* - `pipeline` — this runner's own root step on decoded pixels (`steps`).
|
|
22142
|
+
* - `onboard` — the CAMERA's own detector, admitted only when it is named
|
|
22143
|
+
* here. Its boxes reach post-analysis on the same
|
|
22144
|
+
* `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
|
|
22145
|
+
* track gets the same tracker, the same overlay and the same detail
|
|
22146
|
+
* subtree (face / plate / embedding).
|
|
22147
|
+
*
|
|
22148
|
+
* `['onboard']` alone is the REPLACEMENT: this runner's root step does not
|
|
22149
|
+
* run, and that is where a camera with a usable onboard detector buys back
|
|
22150
|
+
* its share of the accelerator. It saves the root inference, not the decode
|
|
22151
|
+
* — the detail subtree still needs pixels to cut crops from.
|
|
22152
|
+
*
|
|
22153
|
+
* A camera whose onboard detections carry no geometry cannot serve as a root
|
|
22154
|
+
* step at all (there is nothing to track), and the cap that knows this says
|
|
22155
|
+
* so on `native-object-detection.getOptions().geometry`. On Reolink that is
|
|
22156
|
+
* every battery camera: the boxes ride a sub-stream a battery camera never
|
|
22157
|
+
* attaches, so such a camera stays on `['pipeline']` and its onboard AI is
|
|
22158
|
+
* worth exactly what it already is — a wake signal with a class.
|
|
22159
|
+
*
|
|
22160
|
+
* Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
|
|
22161
|
+
* vendor never turns a detector on for the operator, and neither does a
|
|
22162
|
+
* default.
|
|
22163
|
+
*/
|
|
22164
|
+
detectionSources: DetectionSourcesSchema.default(["pipeline"]),
|
|
21865
22165
|
pipelineEnabled: boolean().default(true),
|
|
21866
22166
|
/** Ordered tree of video steps. Absent → runner skips video detection. */
|
|
21867
22167
|
steps: array(PipelineStepInputSchema).readonly().optional(),
|
|
@@ -22043,7 +22343,47 @@ var RunnerLocalMetricsSchema = object({
|
|
|
22043
22343
|
queueDepth: number(),
|
|
22044
22344
|
frameLazy: FrameLazyMetricsSchema.optional()
|
|
22045
22345
|
});
|
|
22346
|
+
/**
|
|
22347
|
+
* Pipeline Runner capability — runtime detection workhorse.
|
|
22348
|
+
*
|
|
22349
|
+
* One instance per node. Receives camera assignments from
|
|
22350
|
+
* `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
|
|
22351
|
+
* decoded frames, drains motion + detection queues, calls the local
|
|
22352
|
+
* `motion-detection` and `pipeline-executor` capabilities, and emits typed
|
|
22353
|
+
* `pipeline.inference-result` and `detection.motion-analysis` events on
|
|
22354
|
+
* the bus.
|
|
22355
|
+
*
|
|
22356
|
+
* Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
|
|
22357
|
+
* runner has zero knowledge of other agents, no global state, and never
|
|
22358
|
+
* makes assignment decisions itself.
|
|
22359
|
+
*/
|
|
22360
|
+
/**
|
|
22361
|
+
* Why a runner declined to look at a camera out of band. Named rather than a
|
|
22362
|
+
* bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
|
|
22363
|
+
* already mid-session and one already bursting are four different facts, and a
|
|
22364
|
+
* caller told only "no" cannot tell a protection from a bug.
|
|
22365
|
+
*/
|
|
22366
|
+
var OccupancyBurstRefusalSchema = _enum([
|
|
22367
|
+
"not-attached",
|
|
22368
|
+
"battery-asleep",
|
|
22369
|
+
"not-watching",
|
|
22370
|
+
"already-bursting"
|
|
22371
|
+
]);
|
|
22046
22372
|
method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
|
|
22373
|
+
deviceId: number(),
|
|
22374
|
+
/** How many frames to collect. The caller sizes this against what its
|
|
22375
|
+
* own confirmation needs; the runner clamps it to the field's range. */
|
|
22376
|
+
frames: number().int().positive().optional(),
|
|
22377
|
+
/** Why, for the log. A burst nobody can attribute is a cost nobody can
|
|
22378
|
+
* defend — the periodic one at least has a timer to point at. */
|
|
22379
|
+
reason: string()
|
|
22380
|
+
}), object({
|
|
22381
|
+
started: boolean(),
|
|
22382
|
+
refusedBecause: OccupancyBurstRefusalSchema.optional()
|
|
22383
|
+
}), {
|
|
22384
|
+
auth: "admin",
|
|
22385
|
+
kind: "mutation"
|
|
22386
|
+
}), method(object({
|
|
22047
22387
|
handle: FrameHandleSchema,
|
|
22048
22388
|
bbox: NativeCropBboxSchema,
|
|
22049
22389
|
maxWidth: number().int().positive().optional(),
|
|
@@ -24413,10 +24753,28 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
24413
24753
|
}), boolean()), method(object({
|
|
24414
24754
|
deviceId: number().int().nonnegative(),
|
|
24415
24755
|
sessionId: string()
|
|
24416
|
-
}), object({
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24756
|
+
}), object({
|
|
24757
|
+
pendingRenegotiation: object({
|
|
24758
|
+
target: WebrtcStreamTargetSchema,
|
|
24759
|
+
epoch: number()
|
|
24760
|
+
}).nullable(),
|
|
24761
|
+
/**
|
|
24762
|
+
* Whether the session still EXISTS.
|
|
24763
|
+
*
|
|
24764
|
+
* A consumer that holds a resource for the life of a session needs to
|
|
24765
|
+
* be able to ask, because a session does not always end the way it
|
|
24766
|
+
* began. Measured on this hub 2026-09-13: an Echo that got stuck never
|
|
24767
|
+
* sent `SessionDisconnected`, so the Alexa exporter's
|
|
24768
|
+
* `releaseEgressTranscode` never ran, and a 2304x1296 HEVC to 720p
|
|
24769
|
+
* H.264 transcode kept running for NOBODY for more than twenty
|
|
24770
|
+
* minutes. The WebRTC session had logged `WebRTC session closed`
|
|
24771
|
+
* minutes earlier — the broker knew; the holder had no way to ask.
|
|
24772
|
+
*
|
|
24773
|
+
* `false` for a session id the provider has never heard of, which is
|
|
24774
|
+
* the same answer as "it ended": either way nothing is holding it up.
|
|
24775
|
+
*/
|
|
24776
|
+
alive: boolean()
|
|
24777
|
+
}));
|
|
24420
24778
|
object({
|
|
24421
24779
|
/** All accessory children of the parent. */
|
|
24422
24780
|
childDeviceIds: array(number()).readonly(),
|
|
@@ -27530,7 +27888,7 @@ var NativeDetectionSchema = object({
|
|
|
27530
27888
|
/** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
|
|
27531
27889
|
confidence: number().min(0).max(1).optional()
|
|
27532
27890
|
});
|
|
27533
|
-
object({
|
|
27891
|
+
var NativeObjectDetectionStatusSchema = object({
|
|
27534
27892
|
/**
|
|
27535
27893
|
* Last observed instance per class. Missing entries mean the class
|
|
27536
27894
|
* is supported but nothing has been seen since the provider started.
|
|
@@ -27547,14 +27905,56 @@ object({
|
|
|
27547
27905
|
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
27548
27906
|
/**
|
|
27549
27907
|
* Whether forwarding of onboard AI detections is enabled for this device.
|
|
27550
|
-
*
|
|
27551
|
-
*
|
|
27908
|
+
*
|
|
27909
|
+
* Cold-start OFF on every camera. A vendor does not decide which detector a
|
|
27910
|
+
* camera runs — that is the operator's choice, and it is made where every
|
|
27911
|
+
* other detection choice is made. `geometry` on
|
|
27912
|
+
* {@link NativeObjectDetectionOptionsSchema} is how the form says what the
|
|
27913
|
+
* choice would buy this particular camera.
|
|
27552
27914
|
*/
|
|
27553
27915
|
enabled: boolean()
|
|
27554
|
-
})
|
|
27916
|
+
});
|
|
27917
|
+
/**
|
|
27918
|
+
* WHEN a camera's onboard detections carry geometry.
|
|
27919
|
+
*
|
|
27920
|
+
* - `boxed` — always. The provider holds a standing channel for the boxes, so
|
|
27921
|
+
* a detection is a trackable subject whenever the camera sees one.
|
|
27922
|
+
* - `while-streaming` — only while some stream of this camera is already open.
|
|
27923
|
+
* The boxes ride the video's own side-channel rather than a feed of their
|
|
27924
|
+
* own, so they cost nothing and they exist only when something is pulling.
|
|
27925
|
+
* On Reolink this is every BATTERY camera: a persistent second feed is real
|
|
27926
|
+
* radio drain, but a camera that is awake is awake precisely because
|
|
27927
|
+
* something is in front of it, and its stream is already being pulled.
|
|
27928
|
+
* - `flag-only` — never. The firmware ships the class and nothing else; the
|
|
27929
|
+
* pipeline needs geometry to make a subject, so such a push reaches the
|
|
27930
|
+
* tracker as motion and no further.
|
|
27931
|
+
*
|
|
27932
|
+
* Reported and not inferred, because the operator's question in front of the
|
|
27933
|
+
* picker is "what do I get", and these are three different answers (D14: the
|
|
27934
|
+
* derived form is only as honest as `getOptions`).
|
|
27935
|
+
*/
|
|
27936
|
+
var NativeObjectGeometryEnum = _enum([
|
|
27937
|
+
"boxed",
|
|
27938
|
+
"while-streaming",
|
|
27939
|
+
"flag-only"
|
|
27940
|
+
]);
|
|
27941
|
+
var NativeObjectDetectionOptionsSchema = object({
|
|
27942
|
+
/** Classes this firmware can detect — the same list the status reports. */
|
|
27943
|
+
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
27944
|
+
/** What a detection from this camera carries. */
|
|
27945
|
+
geometry: NativeObjectGeometryEnum
|
|
27946
|
+
});
|
|
27947
|
+
var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
|
|
27948
|
+
NativeObjectDetectionStatusSchema.extend({
|
|
27555
27949
|
/** Required by createRuntimeStateBridge — epoch ms of last refresh. */
|
|
27556
27950
|
lastFetchedAt: number() });
|
|
27557
|
-
DeviceType.Camera, method(object({
|
|
27951
|
+
DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
|
|
27952
|
+
deviceId: number(),
|
|
27953
|
+
settings: NativeObjectDetectionSettingsPatchSchema
|
|
27954
|
+
}), _void(), {
|
|
27955
|
+
kind: "mutation",
|
|
27956
|
+
auth: "admin"
|
|
27957
|
+
}), method(object({
|
|
27558
27958
|
deviceId: number(),
|
|
27559
27959
|
enabled: boolean()
|
|
27560
27960
|
}), _void(), {
|
|
@@ -31378,7 +31778,28 @@ var PerScopeBreakdownSchema = object({
|
|
|
31378
31778
|
/** Total tracked objects in this scope (frame / zone / unzoned). */
|
|
31379
31779
|
totalObjects: number().int().nonnegative(),
|
|
31380
31780
|
/** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
|
|
31381
|
-
byClass: record(string(), number().int().nonnegative())
|
|
31781
|
+
byClass: record(string(), number().int().nonnegative()),
|
|
31782
|
+
/**
|
|
31783
|
+
* Of `totalObjects`, how many are STANDING — objects the census holds,
|
|
31784
|
+
* present but not going anywhere (a parked car, a bin, a statue).
|
|
31785
|
+
*
|
|
31786
|
+
* The operator's question about a scene has two halves and they answer
|
|
31787
|
+
* different things: "what is parked here" is stable for hours and must not
|
|
31788
|
+
* flap, while "who is walking through" is the thing an alert is about. One
|
|
31789
|
+
* number could only serve one of them, and `totalObjects` served the first
|
|
31790
|
+
* badly — a passer-by moved it and every occupancy rule saw a change.
|
|
31791
|
+
*
|
|
31792
|
+
* `standing + transient === totalObjects`, always. The total keeps its old
|
|
31793
|
+
* meaning exactly, so no rule written against it changes behaviour.
|
|
31794
|
+
*
|
|
31795
|
+
* ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
|
|
31796
|
+
* this field cannot say, and a reader that folds absence in as 0 reports "no
|
|
31797
|
+
* parked objects here" about a camera whose lot is full.
|
|
31798
|
+
*/
|
|
31799
|
+
standingObjects: number().int().nonnegative().optional(),
|
|
31800
|
+
/** Of `totalObjects`, how many are passing through. See `standingObjects` —
|
|
31801
|
+
* same absence rule. */
|
|
31802
|
+
transientObjects: number().int().nonnegative().optional()
|
|
31382
31803
|
});
|
|
31383
31804
|
var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
|
|
31384
31805
|
zoneId: string(),
|
|
@@ -34317,12 +34738,24 @@ Object.freeze({
|
|
|
34317
34738
|
addonId: null,
|
|
34318
34739
|
access: "create"
|
|
34319
34740
|
},
|
|
34741
|
+
"nativeObjectDetection.getOptions": {
|
|
34742
|
+
capName: "native-object-detection",
|
|
34743
|
+
capScope: "device",
|
|
34744
|
+
addonId: null,
|
|
34745
|
+
access: "view"
|
|
34746
|
+
},
|
|
34320
34747
|
"nativeObjectDetection.setEnabled": {
|
|
34321
34748
|
capName: "native-object-detection",
|
|
34322
34749
|
capScope: "device",
|
|
34323
34750
|
addonId: null,
|
|
34324
34751
|
access: "create"
|
|
34325
34752
|
},
|
|
34753
|
+
"nativeObjectDetection.setSettings": {
|
|
34754
|
+
capName: "native-object-detection",
|
|
34755
|
+
capScope: "device",
|
|
34756
|
+
addonId: null,
|
|
34757
|
+
access: "create"
|
|
34758
|
+
},
|
|
34326
34759
|
"navigation.getFeatures": {
|
|
34327
34760
|
capName: "navigation",
|
|
34328
34761
|
capScope: "device",
|
|
@@ -34587,6 +35020,12 @@ Object.freeze({
|
|
|
34587
35020
|
addonId: null,
|
|
34588
35021
|
access: "view"
|
|
34589
35022
|
},
|
|
35023
|
+
"notificationRules.getClipRetentionAsks": {
|
|
35024
|
+
capName: "notification-rules",
|
|
35025
|
+
capScope: "system",
|
|
35026
|
+
addonId: null,
|
|
35027
|
+
access: "view"
|
|
35028
|
+
},
|
|
34590
35029
|
"notificationRules.getConditionCatalog": {
|
|
34591
35030
|
capName: "notification-rules",
|
|
34592
35031
|
capScope: "system",
|
|
@@ -35097,6 +35536,12 @@ Object.freeze({
|
|
|
35097
35536
|
addonId: null,
|
|
35098
35537
|
access: "create"
|
|
35099
35538
|
},
|
|
35539
|
+
"pipelineAnalytics.readLongTermSeries": {
|
|
35540
|
+
capName: "pipeline-analytics",
|
|
35541
|
+
capScope: "device",
|
|
35542
|
+
addonId: null,
|
|
35543
|
+
access: "view"
|
|
35544
|
+
},
|
|
35100
35545
|
"pipelineAnalytics.rebuildObjectEmbeddings": {
|
|
35101
35546
|
capName: "pipeline-analytics",
|
|
35102
35547
|
capScope: "device",
|
|
@@ -35769,6 +36214,12 @@ Object.freeze({
|
|
|
35769
36214
|
addonId: null,
|
|
35770
36215
|
access: "create"
|
|
35771
36216
|
},
|
|
36217
|
+
"pipelineRunner.requestOccupancyBurst": {
|
|
36218
|
+
capName: "pipeline-runner",
|
|
36219
|
+
capScope: "system",
|
|
36220
|
+
addonId: null,
|
|
36221
|
+
access: "create"
|
|
36222
|
+
},
|
|
35772
36223
|
"pipelineRunner.runDetailSubtree": {
|
|
35773
36224
|
capName: "pipeline-runner",
|
|
35774
36225
|
capScope: "system",
|
|
@@ -36981,6 +37432,12 @@ Object.freeze({
|
|
|
36981
37432
|
addonId: null,
|
|
36982
37433
|
access: "create"
|
|
36983
37434
|
},
|
|
37435
|
+
"streamBroker.reportStreamSignal": {
|
|
37436
|
+
capName: "stream-broker",
|
|
37437
|
+
capScope: "system",
|
|
37438
|
+
addonId: null,
|
|
37439
|
+
access: "create"
|
|
37440
|
+
},
|
|
36984
37441
|
"streamBroker.restartProfile": {
|
|
36985
37442
|
capName: "stream-broker",
|
|
36986
37443
|
capScope: "system",
|
|
@@ -37065,6 +37522,12 @@ Object.freeze({
|
|
|
37065
37522
|
addonId: null,
|
|
37066
37523
|
access: "create"
|
|
37067
37524
|
},
|
|
37525
|
+
"streamSignals.listSignals": {
|
|
37526
|
+
capName: "stream-signals",
|
|
37527
|
+
capScope: "device",
|
|
37528
|
+
addonId: null,
|
|
37529
|
+
access: "view"
|
|
37530
|
+
},
|
|
37068
37531
|
"switch.setState": {
|
|
37069
37532
|
capName: "switch",
|
|
37070
37533
|
capScope: "device",
|
|
@@ -38537,11 +39000,21 @@ Object.freeze({
|
|
|
38537
39000
|
form: "single",
|
|
38538
39001
|
optional: false
|
|
38539
39002
|
}],
|
|
39003
|
+
"nativeObjectDetection.getOptions": [{
|
|
39004
|
+
name: "deviceId",
|
|
39005
|
+
form: "single",
|
|
39006
|
+
optional: false
|
|
39007
|
+
}],
|
|
38540
39008
|
"nativeObjectDetection.setEnabled": [{
|
|
38541
39009
|
name: "deviceId",
|
|
38542
39010
|
form: "single",
|
|
38543
39011
|
optional: false
|
|
38544
39012
|
}],
|
|
39013
|
+
"nativeObjectDetection.setSettings": [{
|
|
39014
|
+
name: "deviceId",
|
|
39015
|
+
form: "single",
|
|
39016
|
+
optional: false
|
|
39017
|
+
}],
|
|
38545
39018
|
"navigation.getFeatures": [{
|
|
38546
39019
|
name: "deviceId",
|
|
38547
39020
|
form: "single",
|
|
@@ -38891,6 +39364,11 @@ Object.freeze({
|
|
|
38891
39364
|
form: "single",
|
|
38892
39365
|
optional: false
|
|
38893
39366
|
}],
|
|
39367
|
+
"pipelineAnalytics.readLongTermSeries": [{
|
|
39368
|
+
name: "deviceId",
|
|
39369
|
+
form: "single",
|
|
39370
|
+
optional: false
|
|
39371
|
+
}],
|
|
38894
39372
|
"pipelineAnalytics.rebuildObjectEmbeddings": [{
|
|
38895
39373
|
name: "deviceId",
|
|
38896
39374
|
form: "single",
|
|
@@ -39081,6 +39559,11 @@ Object.freeze({
|
|
|
39081
39559
|
form: "single",
|
|
39082
39560
|
optional: false
|
|
39083
39561
|
}],
|
|
39562
|
+
"pipelineRunner.requestOccupancyBurst": [{
|
|
39563
|
+
name: "deviceId",
|
|
39564
|
+
form: "single",
|
|
39565
|
+
optional: false
|
|
39566
|
+
}],
|
|
39084
39567
|
"pipelineRunner.runDetailSubtree": [{
|
|
39085
39568
|
name: "deviceId",
|
|
39086
39569
|
form: "single",
|
|
@@ -39437,6 +39920,11 @@ Object.freeze({
|
|
|
39437
39920
|
form: "single",
|
|
39438
39921
|
optional: false
|
|
39439
39922
|
}],
|
|
39923
|
+
"streamBroker.reportStreamSignal": [{
|
|
39924
|
+
name: "deviceId",
|
|
39925
|
+
form: "single",
|
|
39926
|
+
optional: false
|
|
39927
|
+
}],
|
|
39440
39928
|
"streamBroker.restartProfile": [{
|
|
39441
39929
|
name: "deviceId",
|
|
39442
39930
|
form: "single",
|
|
@@ -87058,6 +87546,123 @@ function clearPairingFiles(accessoryUuid, logger) {
|
|
|
87058
87546
|
} });
|
|
87059
87547
|
}
|
|
87060
87548
|
}
|
|
87549
|
+
/**
|
|
87550
|
+
* Whether this device's accessory belongs on the bridge.
|
|
87551
|
+
*
|
|
87552
|
+
* A camera is `false` whatever the operator picked — the answer is HomeKit's,
|
|
87553
|
+
* not ours, and an operator who switched it on before the field was gated must
|
|
87554
|
+
* not end up with a camera nobody can pair.
|
|
87555
|
+
*
|
|
87556
|
+
* Absent means ON for everything else: the field did not exist for entries
|
|
87557
|
+
* persisted before it, and the default the operator asked for is the bridge.
|
|
87558
|
+
*/
|
|
87559
|
+
function shouldBridge(input) {
|
|
87560
|
+
if (input.mapperKind === "camera") return false;
|
|
87561
|
+
return input.useBridge !== false;
|
|
87562
|
+
}
|
|
87563
|
+
/** Whether the bridge has room for one more. */
|
|
87564
|
+
function bridgeHasRoom(current) {
|
|
87565
|
+
return current < 149;
|
|
87566
|
+
}
|
|
87567
|
+
//#endregion
|
|
87568
|
+
//#region src/bridge-host.ts
|
|
87569
|
+
/**
|
|
87570
|
+
* THE bridge accessory — one per node, created on demand, holding every
|
|
87571
|
+
* non-camera accessory the operator routed onto it.
|
|
87572
|
+
*
|
|
87573
|
+
* One mDNS advertisement, one HAP connection, one pairing, N accessories
|
|
87574
|
+
* inside. The alternative — what this addon did until now — gives every
|
|
87575
|
+
* switch, sensor and alarm panel its own port, its own advertisement and its
|
|
87576
|
+
* own "Add Accessory" in the Home app. Cameras stay standalone, because
|
|
87577
|
+
* HomeKit forbids bridging them (`bridge-policy.ts`).
|
|
87578
|
+
*
|
|
87579
|
+
* ONE bridge, deliberately. The ceiling is 149 accessories
|
|
87580
|
+
* ({@link MAX_BRIDGED_ACCESSORIES}) and this hub exposes 46 devices in total,
|
|
87581
|
+
* cameras included; a second bridge is a thing to build when the count
|
|
87582
|
+
* approaches the ceiling, not before, and the refusal at the ceiling is
|
|
87583
|
+
* explicit rather than a library throw.
|
|
87584
|
+
*
|
|
87585
|
+
* The bridge is LAZY: it is published the first time an accessory needs it,
|
|
87586
|
+
* so a fleet of nothing but cameras advertises no empty bridge. It is not
|
|
87587
|
+
* unpublished when the last accessory leaves — an unpublish would drop the
|
|
87588
|
+
* pairing record the operator already entered a code for, and an empty bridge
|
|
87589
|
+
* in the Home app is a far smaller cost than a re-pair.
|
|
87590
|
+
*/
|
|
87591
|
+
var BridgeHost = class {
|
|
87592
|
+
opts;
|
|
87593
|
+
bridge = null;
|
|
87594
|
+
published = false;
|
|
87595
|
+
constructor(opts) {
|
|
87596
|
+
this.opts = opts;
|
|
87597
|
+
}
|
|
87598
|
+
/** The live bridge accessory, or `null` before anything needed one. */
|
|
87599
|
+
get accessory() {
|
|
87600
|
+
return this.bridge;
|
|
87601
|
+
}
|
|
87602
|
+
/** How many accessories are riding it right now. */
|
|
87603
|
+
get size() {
|
|
87604
|
+
return this.bridge?.bridgedAccessories.length ?? 0;
|
|
87605
|
+
}
|
|
87606
|
+
/**
|
|
87607
|
+
* Put an accessory on the bridge, publishing the bridge if this is the
|
|
87608
|
+
* first. Returns `false` — without throwing, and having logged — when the
|
|
87609
|
+
* bridge is full: the caller then falls back to standalone, which is worse
|
|
87610
|
+
* for the operator and still works.
|
|
87611
|
+
*/
|
|
87612
|
+
async add(accessory) {
|
|
87613
|
+
const bridge = this.ensure();
|
|
87614
|
+
if (!bridgeHasRoom(bridge.bridgedAccessories.length)) {
|
|
87615
|
+
this.opts.logger.warn("export-hap: the bridge is FULL — publishing standalone instead", { meta: {
|
|
87616
|
+
uuid: accessory.UUID,
|
|
87617
|
+
bridged: bridge.bridgedAccessories.length,
|
|
87618
|
+
max: 149
|
|
87619
|
+
} });
|
|
87620
|
+
return false;
|
|
87621
|
+
}
|
|
87622
|
+
bridge.addBridgedAccessory(accessory);
|
|
87623
|
+
await this.publishOnce();
|
|
87624
|
+
return true;
|
|
87625
|
+
}
|
|
87626
|
+
/** Take an accessory off the bridge. A bridged accessory is never
|
|
87627
|
+
* `unpublish`ed — it has no server of its own. */
|
|
87628
|
+
remove(accessory) {
|
|
87629
|
+
if (this.bridge === null) return;
|
|
87630
|
+
if (!this.bridge.bridgedAccessories.some((a) => a.UUID === accessory.UUID)) return;
|
|
87631
|
+
this.bridge.removeBridgedAccessory(accessory, false);
|
|
87632
|
+
}
|
|
87633
|
+
/** Whether this accessory is currently on the bridge. */
|
|
87634
|
+
holds(accessory) {
|
|
87635
|
+
return this.bridge?.bridgedAccessories.some((a) => a.UUID === accessory.UUID) ?? false;
|
|
87636
|
+
}
|
|
87637
|
+
/** Tear the bridge down — process shutdown only. */
|
|
87638
|
+
async dispose() {
|
|
87639
|
+
if (this.bridge === null || !this.published) return;
|
|
87640
|
+
await unpublishAccessory(this.bridge, this.opts.logger);
|
|
87641
|
+
this.published = false;
|
|
87642
|
+
}
|
|
87643
|
+
ensure() {
|
|
87644
|
+
if (this.bridge !== null) return this.bridge;
|
|
87645
|
+
const bridge = new import_dist.Accessory(this.opts.displayName, this.opts.uuid);
|
|
87646
|
+
bridge.category = import_dist.Categories.BRIDGE;
|
|
87647
|
+
this.bridge = bridge;
|
|
87648
|
+
return bridge;
|
|
87649
|
+
}
|
|
87650
|
+
async publishOnce() {
|
|
87651
|
+
if (this.published || this.bridge === null) return;
|
|
87652
|
+
if (this.opts.publish !== void 0) await this.opts.publish(this.bridge, this.opts.pincode);
|
|
87653
|
+
else await publishStandalone(this.bridge, {
|
|
87654
|
+
pincode: this.opts.pincode,
|
|
87655
|
+
port: 0,
|
|
87656
|
+
bind: this.opts.bind,
|
|
87657
|
+
logger: this.opts.logger
|
|
87658
|
+
});
|
|
87659
|
+
this.published = true;
|
|
87660
|
+
this.opts.logger.info("export-hap: the bridge is published", { meta: {
|
|
87661
|
+
displayName: this.opts.displayName,
|
|
87662
|
+
uuid: this.opts.uuid
|
|
87663
|
+
} });
|
|
87664
|
+
}
|
|
87665
|
+
};
|
|
87061
87666
|
//#endregion
|
|
87062
87667
|
//#region src/hap-setup-uri.ts
|
|
87063
87668
|
function errMsg$15(e) {
|
|
@@ -99465,6 +100070,19 @@ async function startFfmpegForSession(bctx, session, sessionId, video, advertised
|
|
|
99465
100070
|
} });
|
|
99466
100071
|
throw new Error(`export-hap: no enabled RTSP entries for device ${numericDeviceId}`);
|
|
99467
100072
|
}
|
|
100073
|
+
if (fit.kind === "transcode" && bctx.options.hapDeviceSettings?.allowTranscode === false) {
|
|
100074
|
+
startLog.warn("export-hap: stream start REFUSED — transcoding is switched off", {
|
|
100075
|
+
tags: { deviceId: numericDeviceId },
|
|
100076
|
+
meta: {
|
|
100077
|
+
sessionId,
|
|
100078
|
+
streamPreference: pref,
|
|
100079
|
+
negotiated: `${video.width}x${video.height}`,
|
|
100080
|
+
pickedProfile: fit.profile,
|
|
100081
|
+
pickedCodec: fit.picked.codec ?? "unknown"
|
|
100082
|
+
}
|
|
100083
|
+
});
|
|
100084
|
+
throw new Error(`export-hap: device ${numericDeviceId} needs a transcode and transcoding is switched off`);
|
|
100085
|
+
}
|
|
99468
100086
|
const picked = fit.picked;
|
|
99469
100087
|
const rtspUrl = picked.url;
|
|
99470
100088
|
const slot = brokerStreams.find((s) => s.profile === fit.profile);
|
|
@@ -102584,6 +103202,12 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
102584
103202
|
* hardware init.
|
|
102585
103203
|
*/
|
|
102586
103204
|
decodeMemos = createHapDecodeMemos();
|
|
103205
|
+
/**
|
|
103206
|
+
* THE bridge. Lazily created and published the first time a non-camera
|
|
103207
|
+
* accessory needs it; never torn down while the addon runs, because an
|
|
103208
|
+
* unpublish would drop a pairing the operator already entered a code for.
|
|
103209
|
+
*/
|
|
103210
|
+
bridgeHost = null;
|
|
102587
103211
|
constructor() {
|
|
102588
103212
|
super({ ...DEFAULT_CONFIG });
|
|
102589
103213
|
}
|
|
@@ -102591,6 +103215,13 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
102591
103215
|
const identity = await this.ensureIdentity();
|
|
102592
103216
|
this.pincode = identity.pincode;
|
|
102593
103217
|
this.bind = this.config.interfaceName || void 0;
|
|
103218
|
+
this.bridgeHost = new BridgeHost({
|
|
103219
|
+
displayName: this.config.bridgeName,
|
|
103220
|
+
uuid: identity.uuid,
|
|
103221
|
+
pincode: identity.pincode,
|
|
103222
|
+
bind: this.bind,
|
|
103223
|
+
logger: this.ctx.logger
|
|
103224
|
+
});
|
|
102594
103225
|
try {
|
|
102595
103226
|
await initHapStorage(path.join(this.ctx.dataDir, "hap-store"));
|
|
102596
103227
|
} catch (err) {
|
|
@@ -102619,6 +103250,7 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
102619
103250
|
}
|
|
102620
103251
|
this.ctx.addDisposer(async () => {
|
|
102621
103252
|
await this.detachAll();
|
|
103253
|
+
await this.bridgeHost?.dispose();
|
|
102622
103254
|
});
|
|
102623
103255
|
this.subscribeDeviceProvisionedForReconcile();
|
|
102624
103256
|
this.subscribeDeviceReadyForReconcile();
|
|
@@ -102775,16 +103407,24 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
102775
103407
|
decodeMemos: this.decodeMemos,
|
|
102776
103408
|
hapDeviceSettings: {
|
|
102777
103409
|
streamPreference: entrySettings.streamPreference ?? "auto",
|
|
102778
|
-
hksvRecording: resolveHksvRecording(entrySettings)
|
|
103410
|
+
hksvRecording: resolveHksvRecording(entrySettings),
|
|
103411
|
+
allowTranscode: entrySettings.allowTranscode !== false
|
|
102779
103412
|
}
|
|
102780
103413
|
}
|
|
102781
103414
|
});
|
|
102782
|
-
|
|
102783
|
-
|
|
102784
|
-
|
|
102785
|
-
bind: this.bind,
|
|
102786
|
-
logger: this.ctx.logger
|
|
103415
|
+
const wantsBridge = shouldBridge({
|
|
103416
|
+
mapperKind: entry.mapperKind,
|
|
103417
|
+
useBridge: entry.settings?.useBridge
|
|
102787
103418
|
});
|
|
103419
|
+
for (const accessory of mapper.accessories) {
|
|
103420
|
+
if (wantsBridge && this.bridgeHost !== null && await this.bridgeHost.add(accessory)) continue;
|
|
103421
|
+
await publishStandalone(accessory, {
|
|
103422
|
+
pincode: this.pincode,
|
|
103423
|
+
port: 0,
|
|
103424
|
+
bind: this.bind,
|
|
103425
|
+
logger: this.ctx.logger
|
|
103426
|
+
});
|
|
103427
|
+
}
|
|
102788
103428
|
this.exposed.set(entry.deviceId, mapper);
|
|
102789
103429
|
return { childAccessoryUuids: [] };
|
|
102790
103430
|
}
|
|
@@ -102797,7 +103437,13 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
102797
103437
|
const mapper = this.exposed.get(deviceId);
|
|
102798
103438
|
if (!mapper) return;
|
|
102799
103439
|
this.exposed.delete(deviceId);
|
|
102800
|
-
for (const accessory of mapper.accessories)
|
|
103440
|
+
for (const accessory of mapper.accessories) {
|
|
103441
|
+
if (this.bridgeHost?.holds(accessory) === true) {
|
|
103442
|
+
this.bridgeHost.remove(accessory);
|
|
103443
|
+
continue;
|
|
103444
|
+
}
|
|
103445
|
+
await unpublishAccessory(accessory, this.ctx.logger);
|
|
103446
|
+
}
|
|
102801
103447
|
await mapper.dispose().catch((err) => {
|
|
102802
103448
|
this.ctx.logger.withTags({ deviceId: Number.parseInt(deviceId, 10) }).warn("export-hap: mapper dispose failed", { meta: { error: errMsg(err) } });
|
|
102803
103449
|
});
|
|
@@ -103092,42 +103738,79 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
103092
103738
|
const enabledKey = `hap:${deviceId}:enabled`;
|
|
103093
103739
|
const streamPreferenceKey = `hap:${deviceId}:streamPreference`;
|
|
103094
103740
|
const hksvKey = `hap:${deviceId}:hksvRecording`;
|
|
103741
|
+
const useBridgeKey = `hap:${deviceId}:useBridge`;
|
|
103742
|
+
const allowTranscodeKey = `hap:${deviceId}:allowTranscode`;
|
|
103095
103743
|
const mapper = this.exposed.get(String(deviceId)) ?? null;
|
|
103096
103744
|
const paired = mapper ? accessoryPaired(mapper.accessory) : false;
|
|
103745
|
+
const bridged = mapper !== null && this.bridgeHost?.holds(mapper.accessory) === true;
|
|
103097
103746
|
const name = entry?.displayName ?? `Device ${deviceId}`;
|
|
103098
|
-
const
|
|
103747
|
+
const bridgePaired = this.bridgeHost?.accessory !== null && this.bridgeHost?.accessory !== void 0 ? accessoryPaired(this.bridgeHost.accessory) : false;
|
|
103748
|
+
const statusLabel = !enabled ? "Not exposed" : bridged ? bridgePaired ? `On the “${this.config.bridgeName}” bridge, as “${name}”` : `On the “${this.config.bridgeName}” bridge, as “${name}” — the BRIDGE is not paired yet. In iOS Home: + → Add Accessory → “${this.config.bridgeName}”, then enter setup code ${this.config.identity.pincode}. Every bridged device arrives with it.` : paired ? `Paired — exposed as “${name}”` : `Exposed as “${name}” — not paired yet. In iOS Home: + → Add Accessory → “${name}”, then enter setup code ${this.config.identity.pincode}.`;
|
|
103749
|
+
const qrSource = bridged ? this.bridgeHost?.accessory ?? null : mapper?.accessory ?? null;
|
|
103099
103750
|
let qrValue = "";
|
|
103100
|
-
if (
|
|
103101
|
-
qrValue =
|
|
103751
|
+
if (qrSource) try {
|
|
103752
|
+
qrValue = qrSource.setupURI();
|
|
103102
103753
|
} catch (err) {
|
|
103103
103754
|
this.ctx.logger.withTags({ deviceId }).debug("export-hap: setupURI failed for per-device contribution", { meta: { error: errMsg(err) } });
|
|
103104
103755
|
}
|
|
103105
|
-
const
|
|
103106
|
-
type: "select",
|
|
103107
|
-
key: streamPreferenceKey,
|
|
103108
|
-
label: "Source stream (HomeKit)",
|
|
103109
|
-
description: "Which camstack profile slot HomeKit pulls. Auto = the broker picks the slot closest to 1080p at session start.",
|
|
103110
|
-
options: HAP_STREAM_PREFERENCE_OPTIONS,
|
|
103111
|
-
required: true,
|
|
103112
|
-
value: settings.streamPreference,
|
|
103113
|
-
showWhen: {
|
|
103114
|
-
field: enabledKey,
|
|
103115
|
-
equals: true
|
|
103116
|
-
},
|
|
103117
|
-
immediate: true
|
|
103118
|
-
}, {
|
|
103756
|
+
const bridgeFields = kind === "camera" ? [] : [{
|
|
103119
103757
|
type: "boolean",
|
|
103120
|
-
key:
|
|
103121
|
-
label: "
|
|
103122
|
-
description: "
|
|
103758
|
+
key: useBridgeKey,
|
|
103759
|
+
label: "Export through the bridge",
|
|
103760
|
+
description: "Publish this device inside the shared CamStack bridge — one pairing and one entry in Add Accessory for every non-camera device, instead of one each. Turning this off gives it its own advertisement. Either way the switch REBUILDS the accessory and it must be added to the Home app again.",
|
|
103123
103761
|
style: "switch",
|
|
103124
|
-
value:
|
|
103762
|
+
value: shouldBridge({
|
|
103763
|
+
mapperKind: kind,
|
|
103764
|
+
useBridge: settings.useBridge
|
|
103765
|
+
}),
|
|
103125
103766
|
showWhen: {
|
|
103126
103767
|
field: enabledKey,
|
|
103127
103768
|
equals: true
|
|
103128
103769
|
},
|
|
103129
103770
|
immediate: true
|
|
103130
103771
|
}];
|
|
103772
|
+
const cameraFields = kind !== "camera" ? [] : [
|
|
103773
|
+
{
|
|
103774
|
+
type: "select",
|
|
103775
|
+
key: streamPreferenceKey,
|
|
103776
|
+
label: "Source stream (HomeKit)",
|
|
103777
|
+
description: "Which camstack profile slot HomeKit pulls. Auto = the broker picks the slot closest to 1080p at session start.",
|
|
103778
|
+
options: HAP_STREAM_PREFERENCE_OPTIONS,
|
|
103779
|
+
required: true,
|
|
103780
|
+
value: settings.streamPreference,
|
|
103781
|
+
showWhen: {
|
|
103782
|
+
field: enabledKey,
|
|
103783
|
+
equals: true
|
|
103784
|
+
},
|
|
103785
|
+
immediate: true
|
|
103786
|
+
},
|
|
103787
|
+
{
|
|
103788
|
+
type: "boolean",
|
|
103789
|
+
key: hksvKey,
|
|
103790
|
+
label: "HomeKit recording (Secure Video)",
|
|
103791
|
+
description: "Offer “Stream and Allow Recording” in iOS Home. Requires iCloud+ and a home hub. Keeps a continuous 8s prebuffer for this camera (~0.7% of one CPU core, H.264 sources only).",
|
|
103792
|
+
style: "switch",
|
|
103793
|
+
value: resolveHksvRecording(settings),
|
|
103794
|
+
showWhen: {
|
|
103795
|
+
field: enabledKey,
|
|
103796
|
+
equals: true
|
|
103797
|
+
},
|
|
103798
|
+
immediate: true
|
|
103799
|
+
},
|
|
103800
|
+
{
|
|
103801
|
+
type: "boolean",
|
|
103802
|
+
key: allowTranscodeKey,
|
|
103803
|
+
label: "Allow transcoding for HomeKit",
|
|
103804
|
+
description: "Let the hub re-encode this camera when the resolution HomeKit negotiated cannot be served by a direct copy. Off means only a stream that can be forwarded as-is is offered — cheaper, but a session HomeKit negotiates outside what the camera publishes will be refused instead of transcoded.",
|
|
103805
|
+
style: "switch",
|
|
103806
|
+
value: settings.allowTranscode !== false,
|
|
103807
|
+
showWhen: {
|
|
103808
|
+
field: enabledKey,
|
|
103809
|
+
equals: true
|
|
103810
|
+
},
|
|
103811
|
+
immediate: true
|
|
103812
|
+
}
|
|
103813
|
+
];
|
|
103131
103814
|
return {
|
|
103132
103815
|
tabs: [{
|
|
103133
103816
|
id: "export",
|
|
@@ -103172,6 +103855,7 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
103172
103855
|
value: enabled,
|
|
103173
103856
|
immediate: true
|
|
103174
103857
|
},
|
|
103858
|
+
...bridgeFields,
|
|
103175
103859
|
...cameraFields
|
|
103176
103860
|
]
|
|
103177
103861
|
}]
|
|
@@ -103197,14 +103881,20 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
103197
103881
|
const enabledKey = `hap:${deviceId}:enabled`;
|
|
103198
103882
|
const streamPreferenceKey = `hap:${deviceId}:streamPreference`;
|
|
103199
103883
|
const hksvKey = `hap:${deviceId}:hksvRecording`;
|
|
103884
|
+
const useBridgeKey = `hap:${deviceId}:useBridge`;
|
|
103885
|
+
const allowTranscodeKey = `hap:${deviceId}:allowTranscode`;
|
|
103200
103886
|
const enabledValue = enabledKey in patch ? Boolean(patch[enabledKey]) : wasEnabled;
|
|
103201
103887
|
const streamPreferenceRaw = streamPreferenceKey in patch ? patch[streamPreferenceKey] : current?.settings?.streamPreference;
|
|
103202
103888
|
const streamPreference = typeof streamPreferenceRaw === "string" && streamPreferenceRaw.trim().length > 0 ? streamPreferenceRaw : "auto";
|
|
103203
103889
|
const hksvRecording = hksvKey in patch ? Boolean(patch[hksvKey]) : resolveHksvRecording(current?.settings);
|
|
103890
|
+
const useBridge = useBridgeKey in patch ? Boolean(patch[useBridgeKey]) : current?.settings?.useBridge !== false;
|
|
103891
|
+
const allowTranscode = allowTranscodeKey in patch ? Boolean(patch[allowTranscodeKey]) : current?.settings?.allowTranscode !== false;
|
|
103204
103892
|
const nextSettings = {
|
|
103205
103893
|
...current?.settings ?? DEFAULT_DEVICE_SETTINGS,
|
|
103206
103894
|
streamPreference,
|
|
103207
|
-
hksvRecording
|
|
103895
|
+
hksvRecording,
|
|
103896
|
+
useBridge,
|
|
103897
|
+
allowTranscode
|
|
103208
103898
|
};
|
|
103209
103899
|
if (!enabledValue) {
|
|
103210
103900
|
if (wasEnabled) await this.unexposeDevice(deviceIdStr);
|
|
@@ -103217,8 +103907,17 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
103217
103907
|
}
|
|
103218
103908
|
const currentPref = current?.settings?.streamPreference ?? "auto";
|
|
103219
103909
|
const currentHksv = resolveHksvRecording(current?.settings);
|
|
103910
|
+
const mapperKind = current?.mapperKind ?? "generic";
|
|
103911
|
+
const wasBridged = shouldBridge({
|
|
103912
|
+
mapperKind,
|
|
103913
|
+
useBridge: current?.settings?.useBridge
|
|
103914
|
+
});
|
|
103915
|
+
const willBridge = shouldBridge({
|
|
103916
|
+
mapperKind,
|
|
103917
|
+
useBridge
|
|
103918
|
+
});
|
|
103220
103919
|
await this.updateEntrySettings(deviceIdStr, nextSettings);
|
|
103221
|
-
if (currentPref !== streamPreference || currentHksv !== hksvRecording) {
|
|
103920
|
+
if (currentPref !== streamPreference || currentHksv !== hksvRecording || wasBridged !== willBridge) {
|
|
103222
103921
|
log.info("export-hap: per-camera export settings changed — refreshing accessory", { meta: {
|
|
103223
103922
|
streamPreference: {
|
|
103224
103923
|
from: currentPref,
|
|
@@ -103227,10 +103926,14 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
103227
103926
|
hksvRecording: {
|
|
103228
103927
|
from: currentHksv,
|
|
103229
103928
|
to: hksvRecording
|
|
103929
|
+
},
|
|
103930
|
+
bridged: {
|
|
103931
|
+
from: wasBridged,
|
|
103932
|
+
to: willBridge
|
|
103230
103933
|
}
|
|
103231
103934
|
} });
|
|
103232
103935
|
try {
|
|
103233
|
-
await this.unexposeDevice(deviceIdStr, { clearPairing:
|
|
103936
|
+
await this.unexposeDevice(deviceIdStr, { clearPairing: wasBridged !== willBridge });
|
|
103234
103937
|
await this.exposeDevice(deviceIdStr);
|
|
103235
103938
|
} catch (err) {
|
|
103236
103939
|
log.warn("export-hap: failed to refresh accessory after a settings change", { meta: { error: errMsg(err) } });
|