@camstack/addon-provider-gree 0.1.6 → 0.1.7

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
@@ -13394,9 +13394,29 @@ var BaseDevice$1 = class {
13394
13394
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13395
13395
  * `hasSupplementalLight/hasAlarmIo`, etc).
13396
13396
  *
13397
- * Default: no-op (driver had no probe to run).
13397
+ * Default: nothing to probe mark the device PROBED (set `lastProbedAt`) so
13398
+ * the kernel treats it as ready immediately. A device that derives its shape
13399
+ * from a spec (a container, or an accessory sensor) rather than from a
13400
+ * hardware probe has no probe to "complete"; without stamping `lastProbedAt`
13401
+ * it would look perpetually un-probed — logging "Initial probe did not
13402
+ * complete" on every boot and spinning a pointless retry chain. Drivers that
13403
+ * DO probe override this and write their own `feature-probe` slice (including
13404
+ * `lastProbedAt`) once their probe actually succeeds.
13398
13405
  */
13399
- async onProbe() {}
13406
+ async onProbe() {
13407
+ const base = this.runtimeState.getCapState("feature-probe") ?? {
13408
+ flags: {},
13409
+ deviceType: null,
13410
+ model: null,
13411
+ channelCount: null,
13412
+ lastProbedAt: 0,
13413
+ lastFetchedAt: 0
13414
+ };
13415
+ this.runtimeState.setCapState("feature-probe", {
13416
+ ...base,
13417
+ lastProbedAt: Date.now()
13418
+ });
13419
+ }
13400
13420
  /**
13401
13421
  * Phase 5 — fired after the device + its accessories are registered.
13402
13422
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14858,17 +14878,32 @@ var ReleaseInputSchema = object({
14858
14878
  * the parent cascades into every accessory. */
14859
14879
  camDeviceId: number().int().nonnegative()
14860
14880
  });
14861
- var ResyncInputSchema = object({
14862
- /** Parent CamStack device id of an adopted device. The provider resolves its
14863
- * source (integration/broker + native id) and re-aligns the device's
14864
- * structural spec (type/role/capabilities/units) with the live mapping,
14865
- * rebuilding any child whose class changed while preserving operator edits. */
14866
- camDeviceId: number().int().nonnegative() });
14881
+ var ResyncInputSchema = object({
14882
+ /** Parent CamStack device id of an adopted device. The provider resolves its
14883
+ * source (integration/broker + native id) and re-aligns the device's
14884
+ * structural spec (type/role/capabilities/units) with the live mapping,
14885
+ * rebuilding any child whose class changed while preserving operator edits. */
14886
+ camDeviceId: number().int().nonnegative(),
14887
+ /** "Resync from zero" (#19). When true, the kernel PURGES every accessory
14888
+ * child of `camDeviceId` BEFORE the provider re-derives the device, so the
14889
+ * children are rebuilt fresh from source — correct names, coords, and units —
14890
+ * instead of being preserved by the incremental reconcile. Use to recover from
14891
+ * legacy generic/placeholder names that the normal name-precedence keeps frozen
14892
+ * (the operator's explicit reset). Push-driven integrations (no-op resync)
14893
+ * rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
14894
+ * Operator edits on the PARENT (its name, layout, primary-child pick) survive —
14895
+ * only the children are torn down. Omitted/false ⇒ the normal incremental
14896
+ * re-sync that preserves children. */
14897
+ resetToSource: boolean().optional()
14898
+ });
14867
14899
  var ResyncResultSchema = object({
14868
14900
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14869
14901
  changed: boolean(),
14870
14902
  /** Number of child devices rebuilt into a new class by this re-sync. */
14871
- rebuiltChildren: number().int().nonnegative()
14903
+ rebuiltChildren: number().int().nonnegative(),
14904
+ /** Number of accessory children torn down by a `resetToSource` purge before the
14905
+ * provider re-derived the device. 0/absent for a normal incremental re-sync. */
14906
+ removedChildren: number().int().nonnegative().optional()
14872
14907
  });
14873
14908
  var deviceAdoptionCapability = {
14874
14909
  name: "device-adoption",
@@ -16633,6 +16668,11 @@ var DeviceMetaSchema = object({
16633
16668
  addonId: string(),
16634
16669
  type: string(),
16635
16670
  name: string(),
16671
+ /** True once an operator explicitly renamed the device via `setName`. Drives
16672
+ * reconcile name-precedence (preserve operator name vs adopt fresh provider
16673
+ * name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
16674
+ * `DeviceMeta.userNamed`. */
16675
+ userNamed: boolean().optional(),
16636
16676
  location: string().nullable(),
16637
16677
  disabled: boolean(),
16638
16678
  parentDeviceId: number().nullable(),
package/dist/addon.mjs CHANGED
@@ -13393,9 +13393,29 @@ var BaseDevice$1 = class {
13393
13393
  * is open (Reolink writes `hasPtz/hasIntercom`, Hikvision writes
13394
13394
  * `hasSupplementalLight/hasAlarmIo`, etc).
13395
13395
  *
13396
- * Default: no-op (driver had no probe to run).
13396
+ * Default: nothing to probe mark the device PROBED (set `lastProbedAt`) so
13397
+ * the kernel treats it as ready immediately. A device that derives its shape
13398
+ * from a spec (a container, or an accessory sensor) rather than from a
13399
+ * hardware probe has no probe to "complete"; without stamping `lastProbedAt`
13400
+ * it would look perpetually un-probed — logging "Initial probe did not
13401
+ * complete" on every boot and spinning a pointless retry chain. Drivers that
13402
+ * DO probe override this and write their own `feature-probe` slice (including
13403
+ * `lastProbedAt`) once their probe actually succeeds.
13397
13404
  */
13398
- async onProbe() {}
13405
+ async onProbe() {
13406
+ const base = this.runtimeState.getCapState("feature-probe") ?? {
13407
+ flags: {},
13408
+ deviceType: null,
13409
+ model: null,
13410
+ channelCount: null,
13411
+ lastProbedAt: 0,
13412
+ lastFetchedAt: 0
13413
+ };
13414
+ this.runtimeState.setCapState("feature-probe", {
13415
+ ...base,
13416
+ lastProbedAt: Date.now()
13417
+ });
13418
+ }
13399
13419
  /**
13400
13420
  * Phase 5 — fired after the device + its accessories are registered.
13401
13421
  * Drivers publish streams to the broker, kick off background tasks,
@@ -14857,17 +14877,32 @@ var ReleaseInputSchema = object({
14857
14877
  * the parent cascades into every accessory. */
14858
14878
  camDeviceId: number().int().nonnegative()
14859
14879
  });
14860
- var ResyncInputSchema = object({
14861
- /** Parent CamStack device id of an adopted device. The provider resolves its
14862
- * source (integration/broker + native id) and re-aligns the device's
14863
- * structural spec (type/role/capabilities/units) with the live mapping,
14864
- * rebuilding any child whose class changed while preserving operator edits. */
14865
- camDeviceId: number().int().nonnegative() });
14880
+ var ResyncInputSchema = object({
14881
+ /** Parent CamStack device id of an adopted device. The provider resolves its
14882
+ * source (integration/broker + native id) and re-aligns the device's
14883
+ * structural spec (type/role/capabilities/units) with the live mapping,
14884
+ * rebuilding any child whose class changed while preserving operator edits. */
14885
+ camDeviceId: number().int().nonnegative(),
14886
+ /** "Resync from zero" (#19). When true, the kernel PURGES every accessory
14887
+ * child of `camDeviceId` BEFORE the provider re-derives the device, so the
14888
+ * children are rebuilt fresh from source — correct names, coords, and units —
14889
+ * instead of being preserved by the incremental reconcile. Use to recover from
14890
+ * legacy generic/placeholder names that the normal name-precedence keeps frozen
14891
+ * (the operator's explicit reset). Push-driven integrations (no-op resync)
14892
+ * rebuild on their next snapshot; pull/command integrations rebuild in `resync`.
14893
+ * Operator edits on the PARENT (its name, layout, primary-child pick) survive —
14894
+ * only the children are torn down. Omitted/false ⇒ the normal incremental
14895
+ * re-sync that preserves children. */
14896
+ resetToSource: boolean().optional()
14897
+ });
14866
14898
  var ResyncResultSchema = object({
14867
14899
  /** True when the persisted spec actually changed (children may have been rebuilt). */
14868
14900
  changed: boolean(),
14869
14901
  /** Number of child devices rebuilt into a new class by this re-sync. */
14870
- rebuiltChildren: number().int().nonnegative()
14902
+ rebuiltChildren: number().int().nonnegative(),
14903
+ /** Number of accessory children torn down by a `resetToSource` purge before the
14904
+ * provider re-derived the device. 0/absent for a normal incremental re-sync. */
14905
+ removedChildren: number().int().nonnegative().optional()
14871
14906
  });
14872
14907
  var deviceAdoptionCapability = {
14873
14908
  name: "device-adoption",
@@ -16632,6 +16667,11 @@ var DeviceMetaSchema = object({
16632
16667
  addonId: string(),
16633
16668
  type: string(),
16634
16669
  name: string(),
16670
+ /** True once an operator explicitly renamed the device via `setName`. Drives
16671
+ * reconcile name-precedence (preserve operator name vs adopt fresh provider
16672
+ * name). Absent ⇒ treated as user-named (PRESERVE) for legacy rows. See
16673
+ * `DeviceMeta.userNamed`. */
16674
+ userNamed: boolean().optional(),
16635
16675
  location: string().nullable(),
16636
16676
  disabled: boolean(),
16637
16677
  parentDeviceId: number().nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-gree",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
5
5
  "keywords": [
6
6
  "camstack",