@camstack/addon-provider-homeassistant 1.1.8 → 1.1.9

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 CHANGED
@@ -13423,9 +13423,29 @@ var BaseDevice = class {
13423
13423
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13424
13424
  * `hasSupplementalLight/hasAlarmIo`, etc).
13425
13425
  *
13426
- * Default: no-op (driver had no probe to run).
13427
- */
13428
- async onProbe() {}
13426
+ * Default: nothing to probe mark the device PROBED (set `lastProbedAt`) so
13427
+ * the kernel treats it as ready immediately. A device that derives its shape
13428
+ * from a spec (a container, or an accessory sensor) rather than from a
13429
+ * hardware probe has no probe to "complete"; without stamping `lastProbedAt`
13430
+ * it would look perpetually un-probed — logging "Initial probe did not
13431
+ * complete" on every boot and spinning a pointless retry chain. Drivers that
13432
+ * DO probe override this and write their own `feature-probe` slice (including
13433
+ * `lastProbedAt`) once their probe actually succeeds.
13434
+ */
13435
+ async onProbe() {
13436
+ const base = this.runtimeState.getCapState("feature-probe") ?? {
13437
+ flags: {},
13438
+ deviceType: null,
13439
+ model: null,
13440
+ channelCount: null,
13441
+ lastProbedAt: 0,
13442
+ lastFetchedAt: 0
13443
+ };
13444
+ this.runtimeState.setCapState("feature-probe", {
13445
+ ...base,
13446
+ lastProbedAt: Date.now()
13447
+ });
13448
+ }
13429
13449
  /**
13430
13450
  * Phase 5 — fired after the device + its accessories are registered.
13431
13451
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14887,17 +14907,32 @@ var ReleaseInputSchema = object({
14887
14907
  * the parent cascades into every accessory. */
14888
14908
  camDeviceId: number().int().nonnegative()
14889
14909
  });
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() });
14910
+ var ResyncInputSchema = object({
14911
+ /** Parent CamStack device id of an adopted device. The provider resolves its
14912
+ * source (integration/broker + native id) and re-aligns the device's
14913
+ * structural spec (type/role/capabilities/units) with the live mapping,
14914
+ * rebuilding any child whose class changed while preserving operator edits. */
14915
+ camDeviceId: number().int().nonnegative(),
14916
+ /** "Resync from zero" (#19). When true, the kernel PURGES every accessory
14917
+ * child of `camDeviceId` BEFORE the provider re-derives the device, so the
14918
+ * children are rebuilt fresh from source — correct names, coords, and units —
14919
+ * instead of being preserved by the incremental reconcile. Use to recover from
14920
+ * legacy generic/placeholder names that the normal name-precedence keeps frozen
14921
+ * (the operator's explicit reset). Push-driven integrations (no-op resync)
14922
+ * rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
14923
+ * Operator edits on the PARENT (its name, layout, primary-child pick) survive —
14924
+ * only the children are torn down. Omitted/false ⇒ the normal incremental
14925
+ * re-sync that preserves children. */
14926
+ resetToSource: boolean().optional()
14927
+ });
14896
14928
  var ResyncResultSchema = object({
14897
14929
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14898
14930
  changed: boolean(),
14899
14931
  /** Number of child devices rebuilt into a new class by this re-sync. */
14900
- rebuiltChildren: number().int().nonnegative()
14932
+ rebuiltChildren: number().int().nonnegative(),
14933
+ /** Number of accessory children torn down by a `resetToSource` purge before the
14934
+ * provider re-derived the device. 0/absent for a normal incremental re-sync. */
14935
+ removedChildren: number().int().nonnegative().optional()
14901
14936
  });
14902
14937
  var deviceAdoptionCapability = {
14903
14938
  name: "device-adoption",
@@ -16662,6 +16697,11 @@ var DeviceMetaSchema = object({
16662
16697
  addonId: string(),
16663
16698
  type: string(),
16664
16699
  name: string(),
16700
+ /** True once an operator explicitly renamed the device via `setName`. Drives
16701
+ * reconcile name-precedence (preserve operator name vs adopt fresh provider
16702
+ * name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
16703
+ * `DeviceMeta.userNamed`. */
16704
+ userNamed: boolean().optional(),
16665
16705
  location: string().nullable(),
16666
16706
  disabled: boolean(),
16667
16707
  parentDeviceId: number().nullable(),
package/dist/addon.mjs CHANGED
@@ -13422,9 +13422,29 @@ var BaseDevice = class {
13422
13422
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13423
13423
  * `hasSupplementalLight/hasAlarmIo`, etc).
13424
13424
  *
13425
- * Default: no-op (driver had no probe to run).
13426
- */
13427
- async onProbe() {}
13425
+ * Default: nothing to probe mark the device PROBED (set `lastProbedAt`) so
13426
+ * the kernel treats it as ready immediately. A device that derives its shape
13427
+ * from a spec (a container, or an accessory sensor) rather than from a
13428
+ * hardware probe has no probe to "complete"; without stamping `lastProbedAt`
13429
+ * it would look perpetually un-probed — logging "Initial probe did not
13430
+ * complete" on every boot and spinning a pointless retry chain. Drivers that
13431
+ * DO probe override this and write their own `feature-probe` slice (including
13432
+ * `lastProbedAt`) once their probe actually succeeds.
13433
+ */
13434
+ async onProbe() {
13435
+ const base = this.runtimeState.getCapState("feature-probe") ?? {
13436
+ flags: {},
13437
+ deviceType: null,
13438
+ model: null,
13439
+ channelCount: null,
13440
+ lastProbedAt: 0,
13441
+ lastFetchedAt: 0
13442
+ };
13443
+ this.runtimeState.setCapState("feature-probe", {
13444
+ ...base,
13445
+ lastProbedAt: Date.now()
13446
+ });
13447
+ }
13428
13448
  /**
13429
13449
  * Phase 5 — fired after the device + its accessories are registered.
13430
13450
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14886,17 +14906,32 @@ var ReleaseInputSchema = object({
14886
14906
  * the parent cascades into every accessory. */
14887
14907
  camDeviceId: number().int().nonnegative()
14888
14908
  });
14889
- var ResyncInputSchema = object({
14890
- /** Parent CamStack device id of an adopted device. The provider resolves its
14891
- * source (integration/broker + native id) and re-aligns the device's
14892
- * structural spec (type/role/capabilities/units) with the live mapping,
14893
- * rebuilding any child whose class changed while preserving operator edits. */
14894
- camDeviceId: number().int().nonnegative() });
14909
+ var ResyncInputSchema = object({
14910
+ /** Parent CamStack device id of an adopted device. The provider resolves its
14911
+ * source (integration/broker + native id) and re-aligns the device's
14912
+ * structural spec (type/role/capabilities/units) with the live mapping,
14913
+ * rebuilding any child whose class changed while preserving operator edits. */
14914
+ camDeviceId: number().int().nonnegative(),
14915
+ /** "Resync from zero" (#19). When true, the kernel PURGES every accessory
14916
+ * child of `camDeviceId` BEFORE the provider re-derives the device, so the
14917
+ * children are rebuilt fresh from source — correct names, coords, and units —
14918
+ * instead of being preserved by the incremental reconcile. Use to recover from
14919
+ * legacy generic/placeholder names that the normal name-precedence keeps frozen
14920
+ * (the operator's explicit reset). Push-driven integrations (no-op resync)
14921
+ * rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
14922
+ * Operator edits on the PARENT (its name, layout, primary-child pick) survive —
14923
+ * only the children are torn down. Omitted/false ⇒ the normal incremental
14924
+ * re-sync that preserves children. */
14925
+ resetToSource: boolean().optional()
14926
+ });
14895
14927
  var ResyncResultSchema = object({
14896
14928
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14897
14929
  changed: boolean(),
14898
14930
  /** Number of child devices rebuilt into a new class by this re-sync. */
14899
- rebuiltChildren: number().int().nonnegative()
14931
+ rebuiltChildren: number().int().nonnegative(),
14932
+ /** Number of accessory children torn down by a `resetToSource` purge before the
14933
+ * provider re-derived the device. 0/absent for a normal incremental re-sync. */
14934
+ removedChildren: number().int().nonnegative().optional()
14900
14935
  });
14901
14936
  var deviceAdoptionCapability = {
14902
14937
  name: "device-adoption",
@@ -16661,6 +16696,11 @@ var DeviceMetaSchema = object({
16661
16696
  addonId: string(),
16662
16697
  type: string(),
16663
16698
  name: string(),
16699
+ /** True once an operator explicitly renamed the device via `setName`. Drives
16700
+ * reconcile name-precedence (preserve operator name vs adopt fresh provider
16701
+ * name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
16702
+ * `DeviceMeta.userNamed`. */
16703
+ userNamed: boolean().optional(),
16664
16704
  location: string().nullable(),
16665
16705
  disabled: boolean(),
16666
16706
  parentDeviceId: number().nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",