@camstack/addon-matter-broker 0.1.4 → 0.1.6
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 +125 -26
- package/dist/addon.mjs +125 -26
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -4656,7 +4656,7 @@ function preprocess(fn, schema) {
|
|
|
4656
4656
|
});
|
|
4657
4657
|
}
|
|
4658
4658
|
//#endregion
|
|
4659
|
-
//#region ../types/dist/sleep-
|
|
4659
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4660
4660
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4661
4661
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4662
4662
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6456,6 +6456,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6456
6456
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6457
6457
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6458
6458
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6459
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6460
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6461
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6462
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6463
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6464
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6465
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6466
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6467
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6468
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6469
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6459
6470
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6460
6471
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6461
6472
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10080,15 +10091,18 @@ var humiditySensorCapability = {
|
|
|
10080
10091
|
runtimeState: HumiditySensorStatusSchema
|
|
10081
10092
|
};
|
|
10082
10093
|
/**
|
|
10083
|
-
* Image display cap. Models
|
|
10084
|
-
*
|
|
10094
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10095
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10085
10096
|
*
|
|
10086
|
-
* Read-only: there are no setters. The provider resolves
|
|
10087
|
-
*
|
|
10088
|
-
*
|
|
10089
|
-
*
|
|
10090
|
-
*
|
|
10091
|
-
*
|
|
10097
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10098
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10099
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10100
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10101
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10102
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10103
|
+
* Image child device grouped under the robot's container.
|
|
10104
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10105
|
+
* image changes when the source's last-updated marker changes.
|
|
10092
10106
|
*/
|
|
10093
10107
|
var ImageStatusSchema = object({
|
|
10094
10108
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10114,18 +10128,47 @@ var imageCapability = {
|
|
|
10114
10128
|
*/
|
|
10115
10129
|
runtimeState: ImageStatusSchema
|
|
10116
10130
|
};
|
|
10131
|
+
/**
|
|
10132
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10133
|
+
* with a mowing lifecycle plus a dock action.
|
|
10134
|
+
*
|
|
10135
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10136
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10137
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10138
|
+
*
|
|
10139
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10140
|
+
* `dock` sends the mower back to its charging station.
|
|
10141
|
+
*/
|
|
10142
|
+
var LawnMowerActivitySchema = _enum([
|
|
10143
|
+
"idle",
|
|
10144
|
+
"mowing",
|
|
10145
|
+
"paused",
|
|
10146
|
+
"docked",
|
|
10147
|
+
"error"
|
|
10148
|
+
]);
|
|
10149
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10150
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10151
|
+
"info",
|
|
10152
|
+
"warning",
|
|
10153
|
+
"error"
|
|
10154
|
+
]);
|
|
10117
10155
|
var LawnMowerControlStatusSchema = object({
|
|
10118
10156
|
/** Lifecycle activity of the mower. */
|
|
10119
|
-
activity:
|
|
10120
|
-
"idle",
|
|
10121
|
-
"mowing",
|
|
10122
|
-
"paused",
|
|
10123
|
-
"docked",
|
|
10124
|
-
"error"
|
|
10125
|
-
]),
|
|
10157
|
+
activity: LawnMowerActivitySchema,
|
|
10126
10158
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10127
10159
|
* reading. */
|
|
10128
10160
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10161
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10162
|
+
* task is active / progress is unavailable. */
|
|
10163
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10164
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10165
|
+
* or null when unknown. */
|
|
10166
|
+
currentCode: number().nullable(),
|
|
10167
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10168
|
+
currentCodeLabel: string$2().nullable(),
|
|
10169
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10170
|
+
* attention; `info` is normal status. */
|
|
10171
|
+
severity: DeviceCodeSeveritySchema,
|
|
10129
10172
|
/** Ms epoch when the slice was last updated. */
|
|
10130
10173
|
lastChangedAt: number()
|
|
10131
10174
|
});
|
|
@@ -12351,6 +12394,7 @@ var VacuumStateSchema = _enum([
|
|
|
12351
12394
|
"paused",
|
|
12352
12395
|
"returning",
|
|
12353
12396
|
"docked",
|
|
12397
|
+
"drying",
|
|
12354
12398
|
"error"
|
|
12355
12399
|
]);
|
|
12356
12400
|
/**
|
|
@@ -12389,6 +12433,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12389
12433
|
detergent: TankStatusSchema.nullable(),
|
|
12390
12434
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12391
12435
|
dustBin: TankStatusSchema.nullable(),
|
|
12436
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12437
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12438
|
+
/** Current error code (0 / null = no error). */
|
|
12439
|
+
errorCode: number().nullable(),
|
|
12440
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12441
|
+
errorLabel: string$2().nullable(),
|
|
12392
12442
|
/** Ms epoch when the slice was last updated. */
|
|
12393
12443
|
lastChangedAt: number()
|
|
12394
12444
|
});
|
|
@@ -13355,9 +13405,29 @@ var BaseDevice = class {
|
|
|
13355
13405
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13356
13406
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13357
13407
|
*
|
|
13358
|
-
* Default:
|
|
13359
|
-
|
|
13360
|
-
|
|
13408
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13409
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13410
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13411
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13412
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13413
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13414
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13415
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13416
|
+
*/
|
|
13417
|
+
async onProbe() {
|
|
13418
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13419
|
+
flags: {},
|
|
13420
|
+
deviceType: null,
|
|
13421
|
+
model: null,
|
|
13422
|
+
channelCount: null,
|
|
13423
|
+
lastProbedAt: 0,
|
|
13424
|
+
lastFetchedAt: 0
|
|
13425
|
+
};
|
|
13426
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13427
|
+
...base,
|
|
13428
|
+
lastProbedAt: Date.now()
|
|
13429
|
+
});
|
|
13430
|
+
}
|
|
13361
13431
|
/**
|
|
13362
13432
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13363
13433
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -14819,17 +14889,32 @@ var ReleaseInputSchema = object({
|
|
|
14819
14889
|
* the parent cascades into every accessory. */
|
|
14820
14890
|
camDeviceId: number().int().nonnegative()
|
|
14821
14891
|
});
|
|
14822
|
-
var ResyncInputSchema = object({
|
|
14823
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14824
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
14825
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14826
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14827
|
-
camDeviceId: number().int().nonnegative()
|
|
14892
|
+
var ResyncInputSchema = object({
|
|
14893
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14894
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
14895
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14896
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14897
|
+
camDeviceId: number().int().nonnegative(),
|
|
14898
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
14899
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
14900
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
14901
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
14902
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
14903
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
14904
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
14905
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
14906
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
14907
|
+
* re-sync that preserves children. */
|
|
14908
|
+
resetToSource: boolean().optional()
|
|
14909
|
+
});
|
|
14828
14910
|
var ResyncResultSchema = object({
|
|
14829
14911
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
14830
14912
|
changed: boolean(),
|
|
14831
14913
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
14832
|
-
rebuiltChildren: number().int().nonnegative()
|
|
14914
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
14915
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
14916
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
14917
|
+
removedChildren: number().int().nonnegative().optional()
|
|
14833
14918
|
});
|
|
14834
14919
|
var deviceAdoptionCapability = {
|
|
14835
14920
|
name: "device-adoption",
|
|
@@ -16594,6 +16679,11 @@ var DeviceMetaSchema = object({
|
|
|
16594
16679
|
addonId: string$2(),
|
|
16595
16680
|
type: string$2(),
|
|
16596
16681
|
name: string$2(),
|
|
16682
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16683
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16684
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16685
|
+
* `DeviceMeta.userNamed`. */
|
|
16686
|
+
userNamed: boolean().optional(),
|
|
16597
16687
|
location: string$2().nullable(),
|
|
16598
16688
|
disabled: boolean(),
|
|
16599
16689
|
parentDeviceId: number().nullable(),
|
|
@@ -16904,6 +16994,9 @@ method(object({
|
|
|
16904
16994
|
}), method(ReleaseInputSchema.extend({ addonId: string$2() }), _void(), {
|
|
16905
16995
|
kind: "mutation",
|
|
16906
16996
|
auth: "admin"
|
|
16997
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
16998
|
+
kind: "mutation",
|
|
16999
|
+
auth: "admin"
|
|
16907
17000
|
}), method(object({
|
|
16908
17001
|
deviceId: number(),
|
|
16909
17002
|
key: string$2(),
|
|
@@ -20683,6 +20776,12 @@ Object.freeze({
|
|
|
20683
20776
|
addonId: null,
|
|
20684
20777
|
access: "create"
|
|
20685
20778
|
},
|
|
20779
|
+
"deviceManager.adoptionResync": {
|
|
20780
|
+
capName: "device-manager",
|
|
20781
|
+
capScope: "system",
|
|
20782
|
+
addonId: null,
|
|
20783
|
+
access: "create"
|
|
20784
|
+
},
|
|
20686
20785
|
"deviceManager.allocateDeviceId": {
|
|
20687
20786
|
capName: "device-manager",
|
|
20688
20787
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -4654,7 +4654,7 @@ function preprocess(fn, schema) {
|
|
|
4654
4654
|
});
|
|
4655
4655
|
}
|
|
4656
4656
|
//#endregion
|
|
4657
|
-
//#region ../types/dist/sleep-
|
|
4657
|
+
//#region ../types/dist/sleep-DVmKHFGi.mjs
|
|
4658
4658
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4659
4659
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4660
4660
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6454,6 +6454,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
6454
6454
|
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6455
6455
|
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6456
6456
|
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6457
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
6458
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
6459
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
6460
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
6461
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
6462
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
6463
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
6464
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
6465
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
6466
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
6467
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
6457
6468
|
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6458
6469
|
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6459
6470
|
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
@@ -10078,15 +10089,18 @@ var humiditySensorCapability = {
|
|
|
10078
10089
|
runtimeState: HumiditySensorStatusSchema
|
|
10079
10090
|
};
|
|
10080
10091
|
/**
|
|
10081
|
-
* Image display cap. Models
|
|
10082
|
-
*
|
|
10092
|
+
* Image display cap. Models a single still image exposed by an integration —
|
|
10093
|
+
* a snapshot, a chart, a generated picture, or a robot's cleaning-map render.
|
|
10083
10094
|
*
|
|
10084
|
-
* Read-only: there are no setters. The provider resolves
|
|
10085
|
-
*
|
|
10086
|
-
*
|
|
10087
|
-
*
|
|
10088
|
-
*
|
|
10089
|
-
*
|
|
10095
|
+
* Read-only: there are no setters. The provider resolves whatever upstream
|
|
10096
|
+
* source it has into an ABSOLUTE URL the browser loads directly:
|
|
10097
|
+
* - HA `image.*` entities → the `entity_picture` signed-token path
|
|
10098
|
+
* (token stays in the query string, so no auth header is needed);
|
|
10099
|
+
* - a Dreame/robot map → the cloud/OSS map-image URL (or an addon
|
|
10100
|
+
* data-plane URL serving the rendered map bytes), exposed as its own
|
|
10101
|
+
* Image child device grouped under the robot's container.
|
|
10102
|
+
* The slice carries that URL plus the upstream last-updated timestamp; the
|
|
10103
|
+
* image changes when the source's last-updated marker changes.
|
|
10090
10104
|
*/
|
|
10091
10105
|
var ImageStatusSchema = object({
|
|
10092
10106
|
/** Absolute signed URL the browser loads directly. Null when the
|
|
@@ -10112,18 +10126,47 @@ var imageCapability = {
|
|
|
10112
10126
|
*/
|
|
10113
10127
|
runtimeState: ImageStatusSchema
|
|
10114
10128
|
};
|
|
10129
|
+
/**
|
|
10130
|
+
* Robotic lawn-mower cap. Models HA `lawn_mower.*` entities — anything
|
|
10131
|
+
* with a mowing lifecycle plus a dock action.
|
|
10132
|
+
*
|
|
10133
|
+
* Activity follows HA's canonical lawn-mower lifecycle: `idle` /
|
|
10134
|
+
* `mowing` / `paused` / `docked` / `error`. `batteryLevel` (0..100) is
|
|
10135
|
+
* nullable — some mowers don't report a battery percentage.
|
|
10136
|
+
*
|
|
10137
|
+
* `startMowing` begins a mowing run, `pause` halts it in place, and
|
|
10138
|
+
* `dock` sends the mower back to its charging station.
|
|
10139
|
+
*/
|
|
10140
|
+
var LawnMowerActivitySchema = _enum([
|
|
10141
|
+
"idle",
|
|
10142
|
+
"mowing",
|
|
10143
|
+
"paused",
|
|
10144
|
+
"docked",
|
|
10145
|
+
"error"
|
|
10146
|
+
]);
|
|
10147
|
+
/** Severity of the current device/error code — info (status), warning, error. */
|
|
10148
|
+
var DeviceCodeSeveritySchema = _enum([
|
|
10149
|
+
"info",
|
|
10150
|
+
"warning",
|
|
10151
|
+
"error"
|
|
10152
|
+
]);
|
|
10115
10153
|
var LawnMowerControlStatusSchema = object({
|
|
10116
10154
|
/** Lifecycle activity of the mower. */
|
|
10117
|
-
activity:
|
|
10118
|
-
"idle",
|
|
10119
|
-
"mowing",
|
|
10120
|
-
"paused",
|
|
10121
|
-
"docked",
|
|
10122
|
-
"error"
|
|
10123
|
-
]),
|
|
10155
|
+
activity: LawnMowerActivitySchema,
|
|
10124
10156
|
/** 0..100 battery percentage. Null when the device has no battery
|
|
10125
10157
|
* reading. */
|
|
10126
10158
|
batteryLevel: number().min(0).max(100).nullable(),
|
|
10159
|
+
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
10160
|
+
* task is active / progress is unavailable. */
|
|
10161
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
10162
|
+
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
10163
|
+
* or null when unknown. */
|
|
10164
|
+
currentCode: number().nullable(),
|
|
10165
|
+
/** Human label for {@link currentCode}, or null when undecodable. */
|
|
10166
|
+
currentCodeLabel: string$2().nullable(),
|
|
10167
|
+
/** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
|
|
10168
|
+
* attention; `info` is normal status. */
|
|
10169
|
+
severity: DeviceCodeSeveritySchema,
|
|
10127
10170
|
/** Ms epoch when the slice was last updated. */
|
|
10128
10171
|
lastChangedAt: number()
|
|
10129
10172
|
});
|
|
@@ -12349,6 +12392,7 @@ var VacuumStateSchema = _enum([
|
|
|
12349
12392
|
"paused",
|
|
12350
12393
|
"returning",
|
|
12351
12394
|
"docked",
|
|
12395
|
+
"drying",
|
|
12352
12396
|
"error"
|
|
12353
12397
|
]);
|
|
12354
12398
|
/**
|
|
@@ -12387,6 +12431,12 @@ var VacuumControlStatusSchema = object({
|
|
|
12387
12431
|
detergent: TankStatusSchema.nullable(),
|
|
12388
12432
|
/** Dust bin. Null when the hardware has no dust bin. */
|
|
12389
12433
|
dustBin: TankStatusSchema.nullable(),
|
|
12434
|
+
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
12435
|
+
progressPercent: number().min(0).max(100).nullable(),
|
|
12436
|
+
/** Current error code (0 / null = no error). */
|
|
12437
|
+
errorCode: number().nullable(),
|
|
12438
|
+
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
12439
|
+
errorLabel: string$2().nullable(),
|
|
12390
12440
|
/** Ms epoch when the slice was last updated. */
|
|
12391
12441
|
lastChangedAt: number()
|
|
12392
12442
|
});
|
|
@@ -13353,9 +13403,29 @@ var BaseDevice = class {
|
|
|
13353
13403
|
* is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
|
|
13354
13404
|
* `hasSupplementalLight/hasAlarmIo`, etc).
|
|
13355
13405
|
*
|
|
13356
|
-
* Default:
|
|
13357
|
-
|
|
13358
|
-
|
|
13406
|
+
* Default: nothing to probe → mark the device PROBED (set `lastProbedAt`) so
|
|
13407
|
+
* the kernel treats it as ready immediately. A device that derives its shape
|
|
13408
|
+
* from a spec (a container, or an accessory sensor) rather than from a
|
|
13409
|
+
* hardware probe has no probe to "complete"; without stamping `lastProbedAt`
|
|
13410
|
+
* it would look perpetually un-probed — logging "Initial probe did not
|
|
13411
|
+
* complete" on every boot and spinning a pointless retry chain. Drivers that
|
|
13412
|
+
* DO probe override this and write their own `feature-probe` slice (including
|
|
13413
|
+
* `lastProbedAt`) once their probe actually succeeds.
|
|
13414
|
+
*/
|
|
13415
|
+
async onProbe() {
|
|
13416
|
+
const base = this.runtimeState.getCapState("feature-probe") ?? {
|
|
13417
|
+
flags: {},
|
|
13418
|
+
deviceType: null,
|
|
13419
|
+
model: null,
|
|
13420
|
+
channelCount: null,
|
|
13421
|
+
lastProbedAt: 0,
|
|
13422
|
+
lastFetchedAt: 0
|
|
13423
|
+
};
|
|
13424
|
+
this.runtimeState.setCapState("feature-probe", {
|
|
13425
|
+
...base,
|
|
13426
|
+
lastProbedAt: Date.now()
|
|
13427
|
+
});
|
|
13428
|
+
}
|
|
13359
13429
|
/**
|
|
13360
13430
|
* Phase 5 — fired after the device + its accessories are registered.
|
|
13361
13431
|
* Drivers publish streams to the broker, kick off background tasks,
|
|
@@ -14817,17 +14887,32 @@ var ReleaseInputSchema = object({
|
|
|
14817
14887
|
* the parent cascades into every accessory. */
|
|
14818
14888
|
camDeviceId: number().int().nonnegative()
|
|
14819
14889
|
});
|
|
14820
|
-
var ResyncInputSchema = object({
|
|
14821
|
-
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14822
|
-
* source (integration/broker + native id) and re-aligns the device's
|
|
14823
|
-
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14824
|
-
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14825
|
-
camDeviceId: number().int().nonnegative()
|
|
14890
|
+
var ResyncInputSchema = object({
|
|
14891
|
+
/** Parent CamStack device id of an adopted device. The provider resolves its
|
|
14892
|
+
* source (integration/broker + native id) and re-aligns the device's
|
|
14893
|
+
* structural spec (type/role/capabilities/units) with the live mapping,
|
|
14894
|
+
* rebuilding any child whose class changed while preserving operator edits. */
|
|
14895
|
+
camDeviceId: number().int().nonnegative(),
|
|
14896
|
+
/** "Resync from zero" (#19). When true, the kernel PURGES every accessory
|
|
14897
|
+
* child of `camDeviceId` BEFORE the provider re-derives the device, so the
|
|
14898
|
+
* children are rebuilt fresh from source — correct names, coords, and units —
|
|
14899
|
+
* instead of being preserved by the incremental reconcile. Use to recover from
|
|
14900
|
+
* legacy generic/placeholder names that the normal name-precedence keeps frozen
|
|
14901
|
+
* (the operator's explicit reset). Push-driven integrations (no-op resync)
|
|
14902
|
+
* rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
|
|
14903
|
+
* Operator edits on the PARENT (its name, layout, primary-child pick) survive —
|
|
14904
|
+
* only the children are torn down. Omitted/false ⇒ the normal incremental
|
|
14905
|
+
* re-sync that preserves children. */
|
|
14906
|
+
resetToSource: boolean().optional()
|
|
14907
|
+
});
|
|
14826
14908
|
var ResyncResultSchema = object({
|
|
14827
14909
|
/** True when the persisted spec actually changed (children may have been rebuilt). */
|
|
14828
14910
|
changed: boolean(),
|
|
14829
14911
|
/** Number of child devices rebuilt into a new class by this re-sync. */
|
|
14830
|
-
rebuiltChildren: number().int().nonnegative()
|
|
14912
|
+
rebuiltChildren: number().int().nonnegative(),
|
|
14913
|
+
/** Number of accessory children torn down by a `resetToSource` purge before the
|
|
14914
|
+
* provider re-derived the device. 0/absent for a normal incremental re-sync. */
|
|
14915
|
+
removedChildren: number().int().nonnegative().optional()
|
|
14831
14916
|
});
|
|
14832
14917
|
var deviceAdoptionCapability = {
|
|
14833
14918
|
name: "device-adoption",
|
|
@@ -16592,6 +16677,11 @@ var DeviceMetaSchema = object({
|
|
|
16592
16677
|
addonId: string$2(),
|
|
16593
16678
|
type: string$2(),
|
|
16594
16679
|
name: string$2(),
|
|
16680
|
+
/** True once an operator explicitly renamed the device via `setName`. Drives
|
|
16681
|
+
* reconcile name-precedence (preserve operator name vs adopt fresh provider
|
|
16682
|
+
* name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
|
|
16683
|
+
* `DeviceMeta.userNamed`. */
|
|
16684
|
+
userNamed: boolean().optional(),
|
|
16595
16685
|
location: string$2().nullable(),
|
|
16596
16686
|
disabled: boolean(),
|
|
16597
16687
|
parentDeviceId: number().nullable(),
|
|
@@ -16902,6 +16992,9 @@ method(object({
|
|
|
16902
16992
|
}), method(ReleaseInputSchema.extend({ addonId: string$2() }), _void(), {
|
|
16903
16993
|
kind: "mutation",
|
|
16904
16994
|
auth: "admin"
|
|
16995
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
16996
|
+
kind: "mutation",
|
|
16997
|
+
auth: "admin"
|
|
16905
16998
|
}), method(object({
|
|
16906
16999
|
deviceId: number(),
|
|
16907
17000
|
key: string$2(),
|
|
@@ -20681,6 +20774,12 @@ Object.freeze({
|
|
|
20681
20774
|
addonId: null,
|
|
20682
20775
|
access: "create"
|
|
20683
20776
|
},
|
|
20777
|
+
"deviceManager.adoptionResync": {
|
|
20778
|
+
capName: "device-manager",
|
|
20779
|
+
capScope: "system",
|
|
20780
|
+
addonId: null,
|
|
20781
|
+
access: "create"
|
|
20782
|
+
},
|
|
20684
20783
|
"deviceManager.allocateDeviceId": {
|
|
20685
20784
|
capName: "device-manager",
|
|
20686
20785
|
capScope: "system",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-matter-broker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|