@camstack/addon-provider-rtsp 1.1.6 → 1.1.8
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 +124 -25
- package/dist/addon.mjs +124 -25
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -4642,7 +4642,7 @@ function preprocess(fn, schema) {
|
|
|
4642
4642
|
});
|
|
4643
4643
|
}
|
|
4644
4644
|
//#endregion
|
|
4645
|
-
//#region ../types/dist/sleep-
|
|
4645
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4646
4646
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4647
4647
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4648
4648
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6442,6 +6442,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6442
6442
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6443
6443
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6444
6444
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6445
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6446
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6447
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6448
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6449
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6450
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6451
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6452
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6453
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6454
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6455
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6445
6456
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6446
6457
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6447
6458
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10086,15 +10097,18 @@ var humiditySensorCapability = {
|
|
|
10086
10097
|
runtimeState: HumiditySensorStatusSchema
|
|
10087
10098
|
};
|
|
10088
10099
|
/**
|
|
10089
|
-
* Image display cap. Models
|
|
10090
|
-
*
|
|
10100
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10101
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10091
10102
|
*
|
|
10092
|
-
* Read-only: there are no setters. The provider resolves
|
|
10093
|
-
*
|
|
10094
|
-
*
|
|
10095
|
-
*
|
|
10096
|
-
*
|
|
10097
|
-
*
|
|
10103
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10104
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10105
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10106
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10107
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10108
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10109
|
+
* Image child device grouped under the robot's container.
|
|
10110
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10111
|
+
* image changes when the source's last-updated marker changes.
|
|
10098
10112
|
*/
|
|
10099
10113
|
var ImageStatusSchema = object({
|
|
10100
10114
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10120,18 +10134,47 @@ var imageCapability = {
|
|
|
10120
10134
|
*/
|
|
10121
10135
|
runtimeState: ImageStatusSchema
|
|
10122
10136
|
};
|
|
10137
|
+
/**
|
|
10138
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10139
|
+
* with a mowing lifecycle plus a dock action.
|
|
10140
|
+
*
|
|
10141
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10142
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10143
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10144
|
+
*
|
|
10145
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10146
|
+
* `dock` sends the mower back to its charging station.
|
|
10147
|
+
*/
|
|
10148
|
+
var LawnMowerActivitySchema = _enum([
|
|
10149
|
+
"idle",
|
|
10150
|
+
"mowing",
|
|
10151
|
+
"paused",
|
|
10152
|
+
"docked",
|
|
10153
|
+
"error"
|
|
10154
|
+
]);
|
|
10155
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10156
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10157
|
+
"info",
|
|
10158
|
+
"warning",
|
|
10159
|
+
"error"
|
|
10160
|
+
]);
|
|
10123
10161
|
var LawnMowerControlStatusSchema = object({
|
|
10124
10162
|
/** Lifecycle activity of the mower. */
|
|
10125
|
-
activity:
|
|
10126
|
-
"idle",
|
|
10127
|
-
"mowing",
|
|
10128
|
-
"paused",
|
|
10129
|
-
"docked",
|
|
10130
|
-
"error"
|
|
10131
|
-
]),
|
|
10163
|
+
activity: LawnMowerActivitySchema,
|
|
10132
10164
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10133
10165
|
* reading. */
|
|
10134
10166
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10167
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10168
|
+
* task is active / progress is unavailable. */
|
|
10169
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10170
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10171
|
+
* or null when unknown. */
|
|
10172
|
+
currentCode: number().nullable(),
|
|
10173
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10174
|
+
currentCodeLabel: string().nullable(),
|
|
10175
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10176
|
+
* attention; `info` is normal status. */
|
|
10177
|
+
severity: DeviceCodeSeveritySchema,
|
|
10135
10178
|
/** Ms epoch when the slice was last updated. */
|
|
10136
10179
|
lastChangedAt: number()
|
|
10137
10180
|
});
|
|
@@ -12357,6 +12400,7 @@ var VacuumStateSchema = _enum([
|
|
|
12357
12400
|
"paused",
|
|
12358
12401
|
"returning",
|
|
12359
12402
|
"docked",
|
|
12403
|
+
"drying",
|
|
12360
12404
|
"error"
|
|
12361
12405
|
]);
|
|
12362
12406
|
/**
|
|
@@ -12395,6 +12439,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12395
12439
|
detergent: TankStatusSchema.nullable(),
|
|
12396
12440
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12397
12441
|
dustBin: TankStatusSchema.nullable(),
|
|
12442
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12443
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12444
|
+
/** Current error code (0 / null = no error). */
|
|
12445
|
+
errorCode: number().nullable(),
|
|
12446
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12447
|
+
errorLabel: string().nullable(),
|
|
12398
12448
|
/** Ms epoch when the slice was last updated. */
|
|
12399
12449
|
lastChangedAt: number()
|
|
12400
12450
|
});
|
|
@@ -13361,9 +13411,29 @@ var BaseDevice = class {
|
|
|
13361
13411
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13362
13412
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13363
13413
|
*
|
|
13364
|
-
* Default:
|
|
13414
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13415
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13416
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13417
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13418
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13419
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13420
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13421
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13365
13422
|
*/
|
|
13366
|
-
async onProbe() {
|
|
13423
|
+
async onProbe() {
|
|
13424
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13425
|
+
flags: {},
|
|
13426
|
+
deviceType: null,
|
|
13427
|
+
model: null,
|
|
13428
|
+
channelCount: null,
|
|
13429
|
+
lastProbedAt: 0,
|
|
13430
|
+
lastFetchedAt: 0
|
|
13431
|
+
};
|
|
13432
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13433
|
+
...base,
|
|
13434
|
+
lastProbedAt: Date.now()
|
|
13435
|
+
});
|
|
13436
|
+
}
|
|
13367
13437
|
/**
|
|
13368
13438
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13369
13439
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -14825,17 +14895,32 @@ var ReleaseInputSchema = object({
|
|
|
14825
14895
|
* the parent cascades into every accessory. */
|
|
14826
14896
|
camDeviceId: number().int().nonnegative()
|
|
14827
14897
|
});
|
|
14828
|
-
var ResyncInputSchema = object({
|
|
14829
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14830
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
14831
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14832
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14833
|
-
camDeviceId: number().int().nonnegative()
|
|
14898
|
+
var ResyncInputSchema = object({
|
|
14899
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14900
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
14901
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14902
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14903
|
+
camDeviceId: number().int().nonnegative(),
|
|
14904
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
14905
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
14906
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
14907
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
14908
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
14909
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
14910
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
14911
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
14912
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
14913
|
+
* re-sync that preserves children. */
|
|
14914
|
+
resetToSource: boolean().optional()
|
|
14915
|
+
});
|
|
14834
14916
|
var ResyncResultSchema = object({
|
|
14835
14917
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
14836
14918
|
changed: boolean(),
|
|
14837
14919
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
14838
|
-
rebuiltChildren: number().int().nonnegative()
|
|
14920
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
14921
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
14922
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
14923
|
+
removedChildren: number().int().nonnegative().optional()
|
|
14839
14924
|
});
|
|
14840
14925
|
method(object({ integrationId: string() }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema, ListCandidatesOutputSchema, { auth: "admin" }), method(GetCandidateInputSchema, DiscoveredChildDeviceSchema.nullable(), { auth: "admin" }), method(object({ integrationId: string() }), AdoptionStatusSchema, {
|
|
14841
14926
|
kind: "mutation",
|
|
@@ -16534,6 +16619,11 @@ var DeviceMetaSchema = object({
|
|
|
16534
16619
|
addonId: string(),
|
|
16535
16620
|
type: string(),
|
|
16536
16621
|
name: string(),
|
|
16622
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16623
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16624
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16625
|
+
* `DeviceMeta.userNamed`. */
|
|
16626
|
+
userNamed: boolean().optional(),
|
|
16537
16627
|
location: string().nullable(),
|
|
16538
16628
|
disabled: boolean(),
|
|
16539
16629
|
parentDeviceId: number().nullable(),
|
|
@@ -16844,6 +16934,9 @@ method(object({
|
|
|
16844
16934
|
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
16845
16935
|
kind: "mutation",
|
|
16846
16936
|
auth: "admin"
|
|
16937
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
16938
|
+
kind: "mutation",
|
|
16939
|
+
auth: "admin"
|
|
16847
16940
|
}), method(object({
|
|
16848
16941
|
deviceId: number(),
|
|
16849
16942
|
key: string(),
|
|
@@ -20662,6 +20755,12 @@ Object.freeze({
|
|
|
20662
20755
|
addonId: null,
|
|
20663
20756
|
access: "create"
|
|
20664
20757
|
},
|
|
20758
|
+
"deviceManager.adoptionResync": {
|
|
20759
|
+
capName: "device-manager",
|
|
20760
|
+
capScope: "system",
|
|
20761
|
+
addonId: null,
|
|
20762
|
+
access: "create"
|
|
20763
|
+
},
|
|
20665
20764
|
"deviceManager.allocateDeviceId": {
|
|
20666
20765
|
capName: "device-manager",
|
|
20667
20766
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -4641,7 +4641,7 @@ function preprocess(fn, schema) {
|
|
|
4641
4641
|
});
|
|
4642
4642
|
}
|
|
4643
4643
|
//#endregion
|
|
4644
|
-
//#region ../types/dist/sleep-
|
|
4644
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4645
4645
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4646
4646
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4647
4647
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6441,6 +6441,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6441
6441
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6442
6442
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6443
6443
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6444
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6445
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6446
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6447
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6448
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6449
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6450
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6451
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6452
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6453
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6454
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6444
6455
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6445
6456
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6446
6457
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10085,15 +10096,18 @@ var humiditySensorCapability = {
|
|
|
10085
10096
|
runtimeState: HumiditySensorStatusSchema
|
|
10086
10097
|
};
|
|
10087
10098
|
/**
|
|
10088
|
-
* Image display cap. Models
|
|
10089
|
-
*
|
|
10099
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10100
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10090
10101
|
*
|
|
10091
|
-
* Read-only: there are no setters. The provider resolves
|
|
10092
|
-
*
|
|
10093
|
-
*
|
|
10094
|
-
*
|
|
10095
|
-
*
|
|
10096
|
-
*
|
|
10102
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10103
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10104
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10105
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10106
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10107
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10108
|
+
* Image child device grouped under the robot's container.
|
|
10109
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10110
|
+
* image changes when the source's last-updated marker changes.
|
|
10097
10111
|
*/
|
|
10098
10112
|
var ImageStatusSchema = object({
|
|
10099
10113
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10119,18 +10133,47 @@ var imageCapability = {
|
|
|
10119
10133
|
*/
|
|
10120
10134
|
runtimeState: ImageStatusSchema
|
|
10121
10135
|
};
|
|
10136
|
+
/**
|
|
10137
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10138
|
+
* with a mowing lifecycle plus a dock action.
|
|
10139
|
+
*
|
|
10140
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10141
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10142
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10143
|
+
*
|
|
10144
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10145
|
+
* `dock` sends the mower back to its charging station.
|
|
10146
|
+
*/
|
|
10147
|
+
var LawnMowerActivitySchema = _enum([
|
|
10148
|
+
"idle",
|
|
10149
|
+
"mowing",
|
|
10150
|
+
"paused",
|
|
10151
|
+
"docked",
|
|
10152
|
+
"error"
|
|
10153
|
+
]);
|
|
10154
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10155
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10156
|
+
"info",
|
|
10157
|
+
"warning",
|
|
10158
|
+
"error"
|
|
10159
|
+
]);
|
|
10122
10160
|
var LawnMowerControlStatusSchema = object({
|
|
10123
10161
|
/** Lifecycle activity of the mower. */
|
|
10124
|
-
activity:
|
|
10125
|
-
"idle",
|
|
10126
|
-
"mowing",
|
|
10127
|
-
"paused",
|
|
10128
|
-
"docked",
|
|
10129
|
-
"error"
|
|
10130
|
-
]),
|
|
10162
|
+
activity: LawnMowerActivitySchema,
|
|
10131
10163
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10132
10164
|
* reading. */
|
|
10133
10165
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10166
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10167
|
+
* task is active / progress is unavailable. */
|
|
10168
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10169
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10170
|
+
* or null when unknown. */
|
|
10171
|
+
currentCode: number().nullable(),
|
|
10172
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10173
|
+
currentCodeLabel: string().nullable(),
|
|
10174
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10175
|
+
* attention; `info` is normal status. */
|
|
10176
|
+
severity: DeviceCodeSeveritySchema,
|
|
10134
10177
|
/** Ms epoch when the slice was last updated. */
|
|
10135
10178
|
lastChangedAt: number()
|
|
10136
10179
|
});
|
|
@@ -12356,6 +12399,7 @@ var VacuumStateSchema = _enum([
|
|
|
12356
12399
|
"paused",
|
|
12357
12400
|
"returning",
|
|
12358
12401
|
"docked",
|
|
12402
|
+
"drying",
|
|
12359
12403
|
"error"
|
|
12360
12404
|
]);
|
|
12361
12405
|
/**
|
|
@@ -12394,6 +12438,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12394
12438
|
detergent: TankStatusSchema.nullable(),
|
|
12395
12439
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12396
12440
|
dustBin: TankStatusSchema.nullable(),
|
|
12441
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12442
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12443
|
+
/** Current error code (0 / null = no error). */
|
|
12444
|
+
errorCode: number().nullable(),
|
|
12445
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12446
|
+
errorLabel: string().nullable(),
|
|
12397
12447
|
/** Ms epoch when the slice was last updated. */
|
|
12398
12448
|
lastChangedAt: number()
|
|
12399
12449
|
});
|
|
@@ -13360,9 +13410,29 @@ var BaseDevice = class {
|
|
|
13360
13410
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13361
13411
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13362
13412
|
*
|
|
13363
|
-
* Default:
|
|
13413
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13414
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13415
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13416
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13417
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13418
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13419
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13420
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13364
13421
|
*/
|
|
13365
|
-
async onProbe() {
|
|
13422
|
+
async onProbe() {
|
|
13423
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13424
|
+
flags: {},
|
|
13425
|
+
deviceType: null,
|
|
13426
|
+
model: null,
|
|
13427
|
+
channelCount: null,
|
|
13428
|
+
lastProbedAt: 0,
|
|
13429
|
+
lastFetchedAt: 0
|
|
13430
|
+
};
|
|
13431
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13432
|
+
...base,
|
|
13433
|
+
lastProbedAt: Date.now()
|
|
13434
|
+
});
|
|
13435
|
+
}
|
|
13366
13436
|
/**
|
|
13367
13437
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13368
13438
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -14824,17 +14894,32 @@ var ReleaseInputSchema = object({
|
|
|
14824
14894
|
* the parent cascades into every accessory. */
|
|
14825
14895
|
camDeviceId: number().int().nonnegative()
|
|
14826
14896
|
});
|
|
14827
|
-
var ResyncInputSchema = object({
|
|
14828
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14829
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
14830
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14831
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14832
|
-
camDeviceId: number().int().nonnegative()
|
|
14897
|
+
var ResyncInputSchema = object({
|
|
14898
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14899
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
14900
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14901
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14902
|
+
camDeviceId: number().int().nonnegative(),
|
|
14903
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
14904
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
14905
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
14906
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
14907
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
14908
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
14909
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
14910
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
14911
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
14912
|
+
* re-sync that preserves children. */
|
|
14913
|
+
resetToSource: boolean().optional()
|
|
14914
|
+
});
|
|
14833
14915
|
var ResyncResultSchema = object({
|
|
14834
14916
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
14835
14917
|
changed: boolean(),
|
|
14836
14918
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
14837
|
-
rebuiltChildren: number().int().nonnegative()
|
|
14919
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
14920
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
14921
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
14922
|
+
removedChildren: number().int().nonnegative().optional()
|
|
14838
14923
|
});
|
|
14839
14924
|
method(object({ integrationId: string() }), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema, ListCandidatesOutputSchema, { auth: "admin" }), method(GetCandidateInputSchema, DiscoveredChildDeviceSchema.nullable(), { auth: "admin" }), method(object({ integrationId: string() }), AdoptionStatusSchema, {
|
|
14840
14925
|
kind: "mutation",
|
|
@@ -16533,6 +16618,11 @@ var DeviceMetaSchema = object({
|
|
|
16533
16618
|
addonId: string(),
|
|
16534
16619
|
type: string(),
|
|
16535
16620
|
name: string(),
|
|
16621
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16622
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16623
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16624
|
+
* `DeviceMeta.userNamed`. */
|
|
16625
|
+
userNamed: boolean().optional(),
|
|
16536
16626
|
location: string().nullable(),
|
|
16537
16627
|
disabled: boolean(),
|
|
16538
16628
|
parentDeviceId: number().nullable(),
|
|
@@ -16843,6 +16933,9 @@ method(object({
|
|
|
16843
16933
|
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
16844
16934
|
kind: "mutation",
|
|
16845
16935
|
auth: "admin"
|
|
16936
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
16937
|
+
kind: "mutation",
|
|
16938
|
+
auth: "admin"
|
|
16846
16939
|
}), method(object({
|
|
16847
16940
|
deviceId: number(),
|
|
16848
16941
|
key: string(),
|
|
@@ -20661,6 +20754,12 @@ Object.freeze({
|
|
|
20661
20754
|
addonId: null,
|
|
20662
20755
|
access: "create"
|
|
20663
20756
|
},
|
|
20757
|
+
"deviceManager.adoptionResync": {
|
|
20758
|
+
capName: "device-manager",
|
|
20759
|
+
capScope: "system",
|
|
20760
|
+
addonId: null,
|
|
20761
|
+
access: "create"
|
|
20762
|
+
},
|
|
20664
20763
|
"deviceManager.allocateDeviceId": {
|
|
20665
20764
|
capName: "device-manager",
|
|
20666
20765
|
capScope: "system",
|