@camstack/addon-provider-reolink 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
|
@@ -4655,7 +4655,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4655
4655
|
return inst;
|
|
4656
4656
|
}
|
|
4657
4657
|
//#endregion
|
|
4658
|
-
//#region ../types/dist/sleep-
|
|
4658
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4659
4659
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4660
4660
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4661
4661
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6455,6 +6455,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6455
6455
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6456
6456
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6457
6457
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6458
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6459
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6460
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6461
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6462
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6463
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6464
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6465
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6466
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6467
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6468
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6458
6469
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6459
6470
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6460
6471
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10305,15 +10316,18 @@ var humiditySensorCapability = {
|
|
|
10305
10316
|
runtimeState: HumiditySensorStatusSchema
|
|
10306
10317
|
};
|
|
10307
10318
|
/**
|
|
10308
|
-
* Image display cap. Models
|
|
10309
|
-
*
|
|
10319
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10320
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10310
10321
|
*
|
|
10311
|
-
* Read-only: there are no setters. The provider resolves
|
|
10312
|
-
*
|
|
10313
|
-
*
|
|
10314
|
-
*
|
|
10315
|
-
*
|
|
10316
|
-
*
|
|
10322
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10323
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10324
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10325
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10326
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10327
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10328
|
+
* Image child device grouped under the robot's container.
|
|
10329
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10330
|
+
* image changes when the source's last-updated marker changes.
|
|
10317
10331
|
*/
|
|
10318
10332
|
var ImageStatusSchema = object({
|
|
10319
10333
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10339,18 +10353,47 @@ var imageCapability = {
|
|
|
10339
10353
|
*/
|
|
10340
10354
|
runtimeState: ImageStatusSchema
|
|
10341
10355
|
};
|
|
10356
|
+
/**
|
|
10357
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10358
|
+
* with a mowing lifecycle plus a dock action.
|
|
10359
|
+
*
|
|
10360
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10361
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10362
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10363
|
+
*
|
|
10364
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10365
|
+
* `dock` sends the mower back to its charging station.
|
|
10366
|
+
*/
|
|
10367
|
+
var LawnMowerActivitySchema = _enum([
|
|
10368
|
+
"idle",
|
|
10369
|
+
"mowing",
|
|
10370
|
+
"paused",
|
|
10371
|
+
"docked",
|
|
10372
|
+
"error"
|
|
10373
|
+
]);
|
|
10374
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10375
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10376
|
+
"info",
|
|
10377
|
+
"warning",
|
|
10378
|
+
"error"
|
|
10379
|
+
]);
|
|
10342
10380
|
var LawnMowerControlStatusSchema = object({
|
|
10343
10381
|
/** Lifecycle activity of the mower. */
|
|
10344
|
-
activity:
|
|
10345
|
-
"idle",
|
|
10346
|
-
"mowing",
|
|
10347
|
-
"paused",
|
|
10348
|
-
"docked",
|
|
10349
|
-
"error"
|
|
10350
|
-
]),
|
|
10382
|
+
activity: LawnMowerActivitySchema,
|
|
10351
10383
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10352
10384
|
* reading. */
|
|
10353
10385
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10386
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10387
|
+
* task is active / progress is unavailable. */
|
|
10388
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10389
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10390
|
+
* or null when unknown. */
|
|
10391
|
+
currentCode: number().nullable(),
|
|
10392
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10393
|
+
currentCodeLabel: string().nullable(),
|
|
10394
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10395
|
+
* attention; `info` is normal status. */
|
|
10396
|
+
severity: DeviceCodeSeveritySchema,
|
|
10354
10397
|
/** Ms epoch when the slice was last updated. */
|
|
10355
10398
|
lastChangedAt: number()
|
|
10356
10399
|
});
|
|
@@ -12576,6 +12619,7 @@ var VacuumStateSchema = _enum([
|
|
|
12576
12619
|
"paused",
|
|
12577
12620
|
"returning",
|
|
12578
12621
|
"docked",
|
|
12622
|
+
"drying",
|
|
12579
12623
|
"error"
|
|
12580
12624
|
]);
|
|
12581
12625
|
/**
|
|
@@ -12614,6 +12658,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12614
12658
|
detergent: TankStatusSchema.nullable(),
|
|
12615
12659
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12616
12660
|
dustBin: TankStatusSchema.nullable(),
|
|
12661
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12662
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12663
|
+
/** Current error code (0 / null = no error). */
|
|
12664
|
+
errorCode: number().nullable(),
|
|
12665
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12666
|
+
errorLabel: string().nullable(),
|
|
12617
12667
|
/** Ms epoch when the slice was last updated. */
|
|
12618
12668
|
lastChangedAt: number()
|
|
12619
12669
|
});
|
|
@@ -13580,9 +13630,29 @@ var BaseDevice = class {
|
|
|
13580
13630
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13581
13631
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13582
13632
|
*
|
|
13583
|
-
* Default:
|
|
13633
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13634
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13635
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13636
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13637
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13638
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13639
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13640
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13584
13641
|
*/
|
|
13585
|
-
async onProbe() {
|
|
13642
|
+
async onProbe() {
|
|
13643
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13644
|
+
flags: {},
|
|
13645
|
+
deviceType: null,
|
|
13646
|
+
model: null,
|
|
13647
|
+
channelCount: null,
|
|
13648
|
+
lastProbedAt: 0,
|
|
13649
|
+
lastFetchedAt: 0
|
|
13650
|
+
};
|
|
13651
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13652
|
+
...base,
|
|
13653
|
+
lastProbedAt: Date.now()
|
|
13654
|
+
});
|
|
13655
|
+
}
|
|
13586
13656
|
/**
|
|
13587
13657
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13588
13658
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -15056,17 +15126,32 @@ var ReleaseInputSchema = object({
|
|
|
15056
15126
|
* the parent cascades into every accessory. */
|
|
15057
15127
|
camDeviceId: number().int().nonnegative()
|
|
15058
15128
|
});
|
|
15059
|
-
var ResyncInputSchema = object({
|
|
15060
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
15061
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
15062
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
15063
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
15064
|
-
camDeviceId: number().int().nonnegative()
|
|
15129
|
+
var ResyncInputSchema = object({
|
|
15130
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
15131
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
15132
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
15133
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
15134
|
+
camDeviceId: number().int().nonnegative(),
|
|
15135
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
15136
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
15137
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
15138
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
15139
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
15140
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
15141
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
15142
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
15143
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
15144
|
+
* re-sync that preserves children. */
|
|
15145
|
+
resetToSource: boolean().optional()
|
|
15146
|
+
});
|
|
15065
15147
|
var ResyncResultSchema = object({
|
|
15066
15148
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
15067
15149
|
changed: boolean(),
|
|
15068
15150
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
15069
|
-
rebuiltChildren: number().int().nonnegative()
|
|
15151
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
15152
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
15153
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
15154
|
+
removedChildren: number().int().nonnegative().optional()
|
|
15070
15155
|
});
|
|
15071
15156
|
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, {
|
|
15072
15157
|
kind: "mutation",
|
|
@@ -16765,6 +16850,11 @@ var DeviceMetaSchema = object({
|
|
|
16765
16850
|
addonId: string(),
|
|
16766
16851
|
type: string(),
|
|
16767
16852
|
name: string(),
|
|
16853
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16854
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16855
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16856
|
+
* `DeviceMeta.userNamed`. */
|
|
16857
|
+
userNamed: boolean().optional(),
|
|
16768
16858
|
location: string().nullable(),
|
|
16769
16859
|
disabled: boolean(),
|
|
16770
16860
|
parentDeviceId: number().nullable(),
|
|
@@ -17075,6 +17165,9 @@ method(object({
|
|
|
17075
17165
|
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
17076
17166
|
kind: "mutation",
|
|
17077
17167
|
auth: "admin"
|
|
17168
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
17169
|
+
kind: "mutation",
|
|
17170
|
+
auth: "admin"
|
|
17078
17171
|
}), method(object({
|
|
17079
17172
|
deviceId: number(),
|
|
17080
17173
|
key: string(),
|
|
@@ -21209,6 +21302,12 @@ Object.freeze({
|
|
|
21209
21302
|
addonId: null,
|
|
21210
21303
|
access: "create"
|
|
21211
21304
|
},
|
|
21305
|
+
"deviceManager.adoptionResync": {
|
|
21306
|
+
capName: "device-manager",
|
|
21307
|
+
capScope: "system",
|
|
21308
|
+
addonId: null,
|
|
21309
|
+
access: "create"
|
|
21310
|
+
},
|
|
21212
21311
|
"deviceManager.allocateDeviceId": {
|
|
21213
21312
|
capName: "device-manager",
|
|
21214
21313
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -4650,7 +4650,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4650
4650
|
return inst;
|
|
4651
4651
|
}
|
|
4652
4652
|
//#endregion
|
|
4653
|
-
//#region ../types/dist/sleep-
|
|
4653
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4654
4654
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4655
4655
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4656
4656
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6450,6 +6450,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6450
6450
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6451
6451
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6452
6452
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6453
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6454
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6455
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6456
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6457
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6458
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6459
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6460
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6461
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6462
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6463
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6453
6464
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6454
6465
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6455
6466
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10300,15 +10311,18 @@ var humiditySensorCapability = {
|
|
|
10300
10311
|
runtimeState: HumiditySensorStatusSchema
|
|
10301
10312
|
};
|
|
10302
10313
|
/**
|
|
10303
|
-
* Image display cap. Models
|
|
10304
|
-
*
|
|
10314
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10315
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10305
10316
|
*
|
|
10306
|
-
* Read-only: there are no setters. The provider resolves
|
|
10307
|
-
*
|
|
10308
|
-
*
|
|
10309
|
-
*
|
|
10310
|
-
*
|
|
10311
|
-
*
|
|
10317
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10318
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10319
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10320
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10321
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10322
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10323
|
+
* Image child device grouped under the robot's container.
|
|
10324
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10325
|
+
* image changes when the source's last-updated marker changes.
|
|
10312
10326
|
*/
|
|
10313
10327
|
var ImageStatusSchema = object({
|
|
10314
10328
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10334,18 +10348,47 @@ var imageCapability = {
|
|
|
10334
10348
|
*/
|
|
10335
10349
|
runtimeState: ImageStatusSchema
|
|
10336
10350
|
};
|
|
10351
|
+
/**
|
|
10352
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10353
|
+
* with a mowing lifecycle plus a dock action.
|
|
10354
|
+
*
|
|
10355
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10356
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10357
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10358
|
+
*
|
|
10359
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10360
|
+
* `dock` sends the mower back to its charging station.
|
|
10361
|
+
*/
|
|
10362
|
+
var LawnMowerActivitySchema = _enum([
|
|
10363
|
+
"idle",
|
|
10364
|
+
"mowing",
|
|
10365
|
+
"paused",
|
|
10366
|
+
"docked",
|
|
10367
|
+
"error"
|
|
10368
|
+
]);
|
|
10369
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10370
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10371
|
+
"info",
|
|
10372
|
+
"warning",
|
|
10373
|
+
"error"
|
|
10374
|
+
]);
|
|
10337
10375
|
var LawnMowerControlStatusSchema = object({
|
|
10338
10376
|
/** Lifecycle activity of the mower. */
|
|
10339
|
-
activity:
|
|
10340
|
-
"idle",
|
|
10341
|
-
"mowing",
|
|
10342
|
-
"paused",
|
|
10343
|
-
"docked",
|
|
10344
|
-
"error"
|
|
10345
|
-
]),
|
|
10377
|
+
activity: LawnMowerActivitySchema,
|
|
10346
10378
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10347
10379
|
* reading. */
|
|
10348
10380
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10381
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10382
|
+
* task is active / progress is unavailable. */
|
|
10383
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10384
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10385
|
+
* or null when unknown. */
|
|
10386
|
+
currentCode: number().nullable(),
|
|
10387
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10388
|
+
currentCodeLabel: string().nullable(),
|
|
10389
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10390
|
+
* attention; `info` is normal status. */
|
|
10391
|
+
severity: DeviceCodeSeveritySchema,
|
|
10349
10392
|
/** Ms epoch when the slice was last updated. */
|
|
10350
10393
|
lastChangedAt: number()
|
|
10351
10394
|
});
|
|
@@ -12571,6 +12614,7 @@ var VacuumStateSchema = _enum([
|
|
|
12571
12614
|
"paused",
|
|
12572
12615
|
"returning",
|
|
12573
12616
|
"docked",
|
|
12617
|
+
"drying",
|
|
12574
12618
|
"error"
|
|
12575
12619
|
]);
|
|
12576
12620
|
/**
|
|
@@ -12609,6 +12653,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12609
12653
|
detergent: TankStatusSchema.nullable(),
|
|
12610
12654
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12611
12655
|
dustBin: TankStatusSchema.nullable(),
|
|
12656
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12657
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12658
|
+
/** Current error code (0 / null = no error). */
|
|
12659
|
+
errorCode: number().nullable(),
|
|
12660
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12661
|
+
errorLabel: string().nullable(),
|
|
12612
12662
|
/** Ms epoch when the slice was last updated. */
|
|
12613
12663
|
lastChangedAt: number()
|
|
12614
12664
|
});
|
|
@@ -13575,9 +13625,29 @@ var BaseDevice = class {
|
|
|
13575
13625
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13576
13626
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13577
13627
|
*
|
|
13578
|
-
* Default:
|
|
13628
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13629
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13630
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13631
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13632
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13633
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13634
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13635
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13579
13636
|
*/
|
|
13580
|
-
async onProbe() {
|
|
13637
|
+
async onProbe() {
|
|
13638
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13639
|
+
flags: {},
|
|
13640
|
+
deviceType: null,
|
|
13641
|
+
model: null,
|
|
13642
|
+
channelCount: null,
|
|
13643
|
+
lastProbedAt: 0,
|
|
13644
|
+
lastFetchedAt: 0
|
|
13645
|
+
};
|
|
13646
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13647
|
+
...base,
|
|
13648
|
+
lastProbedAt: Date.now()
|
|
13649
|
+
});
|
|
13650
|
+
}
|
|
13581
13651
|
/**
|
|
13582
13652
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13583
13653
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -15051,17 +15121,32 @@ var ReleaseInputSchema = object({
|
|
|
15051
15121
|
* the parent cascades into every accessory. */
|
|
15052
15122
|
camDeviceId: number().int().nonnegative()
|
|
15053
15123
|
});
|
|
15054
|
-
var ResyncInputSchema = object({
|
|
15055
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
15056
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
15057
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
15058
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
15059
|
-
camDeviceId: number().int().nonnegative()
|
|
15124
|
+
var ResyncInputSchema = object({
|
|
15125
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
15126
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
15127
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
15128
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
15129
|
+
camDeviceId: number().int().nonnegative(),
|
|
15130
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
15131
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
15132
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
15133
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
15134
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
15135
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
15136
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
15137
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
15138
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
15139
|
+
* re-sync that preserves children. */
|
|
15140
|
+
resetToSource: boolean().optional()
|
|
15141
|
+
});
|
|
15060
15142
|
var ResyncResultSchema = object({
|
|
15061
15143
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
15062
15144
|
changed: boolean(),
|
|
15063
15145
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
15064
|
-
rebuiltChildren: number().int().nonnegative()
|
|
15146
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
15147
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
15148
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
15149
|
+
removedChildren: number().int().nonnegative().optional()
|
|
15065
15150
|
});
|
|
15066
15151
|
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, {
|
|
15067
15152
|
kind: "mutation",
|
|
@@ -16760,6 +16845,11 @@ var DeviceMetaSchema = object({
|
|
|
16760
16845
|
addonId: string(),
|
|
16761
16846
|
type: string(),
|
|
16762
16847
|
name: string(),
|
|
16848
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16849
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16850
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16851
|
+
* `DeviceMeta.userNamed`. */
|
|
16852
|
+
userNamed: boolean().optional(),
|
|
16763
16853
|
location: string().nullable(),
|
|
16764
16854
|
disabled: boolean(),
|
|
16765
16855
|
parentDeviceId: number().nullable(),
|
|
@@ -17070,6 +17160,9 @@ method(object({
|
|
|
17070
17160
|
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
17071
17161
|
kind: "mutation",
|
|
17072
17162
|
auth: "admin"
|
|
17163
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
17164
|
+
kind: "mutation",
|
|
17165
|
+
auth: "admin"
|
|
17073
17166
|
}), method(object({
|
|
17074
17167
|
deviceId: number(),
|
|
17075
17168
|
key: string(),
|
|
@@ -21204,6 +21297,12 @@ Object.freeze({
|
|
|
21204
21297
|
addonId: null,
|
|
21205
21298
|
access: "create"
|
|
21206
21299
|
},
|
|
21300
|
+
"deviceManager.adoptionResync": {
|
|
21301
|
+
capName: "device-manager",
|
|
21302
|
+
capScope: "system",
|
|
21303
|
+
addonId: null,
|
|
21304
|
+
access: "create"
|
|
21305
|
+
},
|
|
21207
21306
|
"deviceManager.allocateDeviceId": {
|
|
21208
21307
|
capName: "device-manager",
|
|
21209
21308
|
capScope: "system",
|