@camstack/addon-provider-rtsp 1.1.7 → 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.
Files changed (3) hide show
  1. package/dist/addon.js +112 -24
  2. package/dist/addon.mjs +112 -24
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10097,15 +10097,18 @@ var humiditySensorCapability = {
10097
10097
  runtimeState: HumiditySensorStatusSchema
10098
10098
  };
10099
10099
  /**
10100
- * Image display cap. Models HA `image.*` entities a single still image
10101
- * exposed by an integration (a snapshot, a chart, a generated picture).
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.
10102
10102
  *
10103
- * Read-only: there are no setters. The provider resolves the HA
10104
- * `entity_picture` (a relative, signed-token path) into an ABSOLUTE URL
10105
- * the browser loads directly the token stays in the query string so no
10106
- * auth header is required. The slice carries that URL plus the upstream
10107
- * last-updated timestamp; the image changes when the entity state (a
10108
- * timestamp) changes.
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.
10109
10112
  */
10110
10113
  var ImageStatusSchema = object({
10111
10114
  /** Absolute signed URL the browser loads directly. Null when the
@@ -10131,18 +10134,47 @@ var imageCapability = {
10131
10134
  */
10132
10135
  runtimeState: ImageStatusSchema
10133
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
+ ]);
10134
10161
  var LawnMowerControlStatusSchema = object({
10135
10162
  /** Lifecycle activity of the mower. */
10136
- activity: _enum([
10137
- "idle",
10138
- "mowing",
10139
- "paused",
10140
- "docked",
10141
- "error"
10142
- ]),
10163
+ activity: LawnMowerActivitySchema,
10143
10164
  /** 0..100 battery percentage. Null when the device has no battery
10144
10165
  * reading. */
10145
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,
10146
10178
  /** Ms epoch when the slice was last updated. */
10147
10179
  lastChangedAt: number()
10148
10180
  });
@@ -12368,6 +12400,7 @@ var VacuumStateSchema = _enum([
12368
12400
  "paused",
12369
12401
  "returning",
12370
12402
  "docked",
12403
+ "drying",
12371
12404
  "error"
12372
12405
  ]);
12373
12406
  /**
@@ -12406,6 +12439,12 @@ var VacuumControlStatusSchema = object({
12406
12439
  detergent: TankStatusSchema.nullable(),
12407
12440
  /** Dust bin. Null when the hardware has no dust bin. */
12408
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(),
12409
12448
  /** Ms epoch when the slice was last updated. */
12410
12449
  lastChangedAt: number()
12411
12450
  });
@@ -13372,9 +13411,29 @@ var BaseDevice = class {
13372
13411
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13373
13412
  * `hasSupplementalLight/hasAlarmIo`, etc).
13374
13413
  *
13375
- * Default: no-op (driver had no probe to run).
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.
13376
13422
  */
13377
- 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
+ }
13378
13437
  /**
13379
13438
  * Phase 5 — fired after the device + its accessories are registered.
13380
13439
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14836,17 +14895,32 @@ var ReleaseInputSchema = object({
14836
14895
  * the parent cascades into every accessory. */
14837
14896
  camDeviceId: number().int().nonnegative()
14838
14897
  });
14839
- var ResyncInputSchema = object({
14840
- /** Parent CamStack device id of an adopted device. The provider resolves its
14841
- * source (integration/broker + native id) and re-aligns the device's
14842
- * structural spec (type/role/capabilities/units) with the live mapping,
14843
- * rebuilding any child whose class changed while preserving operator edits. */
14844
- 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
+ });
14845
14916
  var ResyncResultSchema = object({
14846
14917
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14847
14918
  changed: boolean(),
14848
14919
  /** Number of child devices rebuilt into a new class by this re-sync. */
14849
- 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()
14850
14924
  });
14851
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, {
14852
14926
  kind: "mutation",
@@ -16545,6 +16619,11 @@ var DeviceMetaSchema = object({
16545
16619
  addonId: string(),
16546
16620
  type: string(),
16547
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(),
16548
16627
  location: string().nullable(),
16549
16628
  disabled: boolean(),
16550
16629
  parentDeviceId: number().nullable(),
@@ -16855,6 +16934,9 @@ method(object({
16855
16934
  }), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
16856
16935
  kind: "mutation",
16857
16936
  auth: "admin"
16937
+ }), method(ResyncInputSchema, ResyncResultSchema, {
16938
+ kind: "mutation",
16939
+ auth: "admin"
16858
16940
  }), method(object({
16859
16941
  deviceId: number(),
16860
16942
  key: string(),
@@ -20673,6 +20755,12 @@ Object.freeze({
20673
20755
  addonId: null,
20674
20756
  access: "create"
20675
20757
  },
20758
+ "deviceManager.adoptionResync": {
20759
+ capName: "device-manager",
20760
+ capScope: "system",
20761
+ addonId: null,
20762
+ access: "create"
20763
+ },
20676
20764
  "deviceManager.allocateDeviceId": {
20677
20765
  capName: "device-manager",
20678
20766
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -10096,15 +10096,18 @@ var humiditySensorCapability = {
10096
10096
  runtimeState: HumiditySensorStatusSchema
10097
10097
  };
10098
10098
  /**
10099
- * Image display cap. Models HA `image.*` entities a single still image
10100
- * exposed by an integration (a snapshot, a chart, a generated picture).
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.
10101
10101
  *
10102
- * Read-only: there are no setters. The provider resolves the HA
10103
- * `entity_picture` (a relative, signed-token path) into an ABSOLUTE URL
10104
- * the browser loads directly the token stays in the query string so no
10105
- * auth header is required. The slice carries that URL plus the upstream
10106
- * last-updated timestamp; the image changes when the entity state (a
10107
- * timestamp) changes.
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.
10108
10111
  */
10109
10112
  var ImageStatusSchema = object({
10110
10113
  /** Absolute signed URL the browser loads directly. Null when the
@@ -10130,18 +10133,47 @@ var imageCapability = {
10130
10133
  */
10131
10134
  runtimeState: ImageStatusSchema
10132
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
+ ]);
10133
10160
  var LawnMowerControlStatusSchema = object({
10134
10161
  /** Lifecycle activity of the mower. */
10135
- activity: _enum([
10136
- "idle",
10137
- "mowing",
10138
- "paused",
10139
- "docked",
10140
- "error"
10141
- ]),
10162
+ activity: LawnMowerActivitySchema,
10142
10163
  /** 0..100 battery percentage. Null when the device has no battery
10143
10164
  * reading. */
10144
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,
10145
10177
  /** Ms epoch when the slice was last updated. */
10146
10178
  lastChangedAt: number()
10147
10179
  });
@@ -12367,6 +12399,7 @@ var VacuumStateSchema = _enum([
12367
12399
  "paused",
12368
12400
  "returning",
12369
12401
  "docked",
12402
+ "drying",
12370
12403
  "error"
12371
12404
  ]);
12372
12405
  /**
@@ -12405,6 +12438,12 @@ var VacuumControlStatusSchema = object({
12405
12438
  detergent: TankStatusSchema.nullable(),
12406
12439
  /** Dust bin. Null when the hardware has no dust bin. */
12407
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(),
12408
12447
  /** Ms epoch when the slice was last updated. */
12409
12448
  lastChangedAt: number()
12410
12449
  });
@@ -13371,9 +13410,29 @@ var BaseDevice = class {
13371
13410
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13372
13411
  * `hasSupplementalLight/hasAlarmIo`, etc).
13373
13412
  *
13374
- * Default: no-op (driver had no probe to run).
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.
13375
13421
  */
13376
- 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
+ }
13377
13436
  /**
13378
13437
  * Phase 5 — fired after the device + its accessories are registered.
13379
13438
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14835,17 +14894,32 @@ var ReleaseInputSchema = object({
14835
14894
  * the parent cascades into every accessory. */
14836
14895
  camDeviceId: number().int().nonnegative()
14837
14896
  });
14838
- var ResyncInputSchema = object({
14839
- /** Parent CamStack device id of an adopted device. The provider resolves its
14840
- * source (integration/broker + native id) and re-aligns the device's
14841
- * structural spec (type/role/capabilities/units) with the live mapping,
14842
- * rebuilding any child whose class changed while preserving operator edits. */
14843
- 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
+ });
14844
14915
  var ResyncResultSchema = object({
14845
14916
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14846
14917
  changed: boolean(),
14847
14918
  /** Number of child devices rebuilt into a new class by this re-sync. */
14848
- 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()
14849
14923
  });
14850
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, {
14851
14925
  kind: "mutation",
@@ -16544,6 +16618,11 @@ var DeviceMetaSchema = object({
16544
16618
  addonId: string(),
16545
16619
  type: string(),
16546
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(),
16547
16626
  location: string().nullable(),
16548
16627
  disabled: boolean(),
16549
16628
  parentDeviceId: number().nullable(),
@@ -16854,6 +16933,9 @@ method(object({
16854
16933
  }), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
16855
16934
  kind: "mutation",
16856
16935
  auth: "admin"
16936
+ }), method(ResyncInputSchema, ResyncResultSchema, {
16937
+ kind: "mutation",
16938
+ auth: "admin"
16857
16939
  }), method(object({
16858
16940
  deviceId: number(),
16859
16941
  key: string(),
@@ -20672,6 +20754,12 @@ Object.freeze({
20672
20754
  addonId: null,
20673
20755
  access: "create"
20674
20756
  },
20757
+ "deviceManager.adoptionResync": {
20758
+ capName: "device-manager",
20759
+ capScope: "system",
20760
+ addonId: null,
20761
+ access: "create"
20762
+ },
20675
20763
  "deviceManager.allocateDeviceId": {
20676
20764
  capName: "device-manager",
20677
20765
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",