@camstack/addon-provider-bosch 0.1.5 → 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.
@@ -1,5 +1,5 @@
1
- import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, N as union, O as literal, P as unknown, S as customAction, T as isSecretMarkerLike, a as binaryCapability, b as errMsg, c as deviceAdoptionCapability, d as eventEmitterCapability, j as record, l as dishwasherCapability, m as powerMeterCapability, n as BaseDeviceProvider, p as numericSensorCapability, r as DishwasherOperationStateSchema, s as connectionTestCapability, t as BaseDevice, u as enumSensorCapability, v as DeviceRole, w as isSecretMarker, x as createEvent, y as DeviceType } from "../dist-DNznrlG_.mjs";
2
- import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-DW2D0vf8.mjs";
1
+ import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, N as union, O as literal, P as unknown, S as customAction, T as isSecretMarkerLike, a as binaryCapability, b as errMsg, c as deviceAdoptionCapability, d as eventEmitterCapability, j as record, l as dishwasherCapability, m as powerMeterCapability, n as BaseDeviceProvider, p as numericSensorCapability, r as DishwasherOperationStateSchema, s as connectionTestCapability, t as BaseDevice, u as enumSensorCapability, v as DeviceRole, w as isSecretMarker, x as createEvent, y as DeviceType } from "../dist-CWrnWIxD.mjs";
2
+ import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-BTR3H0Hn.mjs";
3
3
  import { createHash, randomBytes } from "node:crypto";
4
4
  import { connect } from "node:tls";
5
5
  import { inflateRawSync } from "node:zlib";
@@ -3916,19 +3916,28 @@ function legacyChildBindings(children) {
3916
3916
  const suffix = Reflect.get(row, "stableIdSuffix");
3917
3917
  const name = Reflect.get(row, "name");
3918
3918
  if (typeof suffix !== "string") continue;
3919
- const known = LEGACY_CHILD_KEYS[suffix];
3920
- if (known === void 0) continue;
3921
- out.push({
3922
- stableIdSuffix: suffix,
3923
- key: known.key,
3924
- cap: known.cap,
3925
- convert: "none",
3926
- role: known.role,
3927
- name: typeof name === "string" && name.length > 0 ? name : suffix
3928
- });
3919
+ const binding = legacyKindBinding(suffix, typeof name === "string" ? name : "");
3920
+ if (binding !== null) out.push(binding);
3929
3921
  }
3930
3922
  return out;
3931
3923
  }
3924
+ /**
3925
+ * The binding a child of the OLD fixed catalog stands for. Its kind is its stable suffix
3926
+ * (`energy-forecast`, `program-phase`, …); the child row it was persisted with carries that
3927
+ * kind as `sensorKind` and no `binding`. `null` for a kind the catalog never had.
3928
+ */
3929
+ function legacyKindBinding(kind, name) {
3930
+ const known = LEGACY_CHILD_KEYS[kind];
3931
+ if (known === void 0) return null;
3932
+ return {
3933
+ stableIdSuffix: kind,
3934
+ key: known.key,
3935
+ cap: known.cap,
3936
+ convert: "none",
3937
+ role: known.role,
3938
+ name: name.length > 0 ? name : kind
3939
+ };
3940
+ }
3932
3941
  function isSyntheticKey(key) {
3933
3942
  return key.startsWith("HomeConnect.Info.") || key.startsWith("HomeConnect.Network.");
3934
3943
  }
@@ -4370,11 +4379,30 @@ var HomeConnectEventDevice = class extends BaseDevice {
4370
4379
  var homeConnectSensorSchema = object({
4371
4380
  haId: string().min(1),
4372
4381
  brokerId: string().min(1),
4373
- binding: HomeConnectChildBindingSchema,
4382
+ /**
4383
+ * The entity this child reads. Absent on a child persisted by the fixed-catalog build,
4384
+ * which wrote `sensorKind` instead — see {@link resolveSensorBinding}.
4385
+ */
4386
+ binding: HomeConnectChildBindingSchema.optional(),
4387
+ /** Fixed-catalog children only: the old kind, which is also their stable suffix. */
4388
+ sensorKind: string().min(1).optional(),
4374
4389
  system: literal("home-connect").optional(),
4375
4390
  integrationId: string().optional()
4376
4391
  });
4377
4392
  /**
4393
+ * The binding of a persisted child row. A restored child's config is the row the KERNEL
4394
+ * kept (a spawn reuses the persisted config for an existing stableId), so a child saved by
4395
+ * the fixed-catalog build arrives with `sensorKind` and no `binding`: it is translated, never
4396
+ * refused — refusing it failed the restore of every such child and left the container's
4397
+ * sensors dead until a re-pair. A row with neither is malformed and throws.
4398
+ */
4399
+ function resolveSensorBinding(config, name) {
4400
+ if (config.binding !== void 0) return config.binding;
4401
+ const legacy = config.sensorKind === void 0 ? null : legacyKindBinding(config.sensorKind, name);
4402
+ if (legacy === null) throw new Error(`Home Connect sensor row has no binding and no known sensorKind (${config.sensorKind ?? "none"})`);
4403
+ return legacy;
4404
+ }
4405
+ /**
4378
4406
  * What `getStatus` answers before the appliance has reported anything. `lastFetchedAt: 0`
4379
4407
  * is the cap's "never fetched" marker; the number beside it is a placeholder the type
4380
4408
  * demands, and it is NEVER written to the runtime slice — a sensor with no value is
@@ -4409,7 +4437,7 @@ var HomeConnectSensorDevice = class extends BaseDevice {
4409
4437
  super(ctx, homeConnectSensorSchema, { type: ctx.deviceMeta.type });
4410
4438
  this.#haId = persisted.haId;
4411
4439
  this.#brokerId = persisted.brokerId;
4412
- this.#binding = persisted.binding;
4440
+ this.#binding = resolveSensorBinding(persisted, ctx.deviceMeta.name);
4413
4441
  this.updateSourceInfo({
4414
4442
  id: `${this.#haId}:${this.#binding.stableIdSuffix}`,
4415
4443
  system: "home-connect"
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-CIIror0W.js");
3
- const require_account_integration_offline = require("../account-integration-offline-BhjIPfv5.js");
2
+ const require_dist = require("../dist-CWtMn1_5.js");
3
+ const require_account_integration_offline = require("../account-integration-offline-Bba0sEkT.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  //#region src/homecom/custom-actions.ts
6
6
  var homeComActions = require_dist.defineCustomActions({
@@ -1,5 +1,5 @@
1
- import { A as object, C as defineCustomActions, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, T as isSecretMarkerLike, _ as waterHeaterCapability, b as errMsg, c as deviceAdoptionCapability, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, w as isSecretMarker, y as DeviceType } from "../dist-DNznrlG_.mjs";
2
- import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-DW2D0vf8.mjs";
1
+ import { A as object, C as defineCustomActions, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, T as isSecretMarkerLike, _ as waterHeaterCapability, b as errMsg, c as deviceAdoptionCapability, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, w as isSecretMarker, y as DeviceType } from "../dist-CWrnWIxD.mjs";
2
+ import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-BTR3H0Hn.mjs";
3
3
  import { createHash, randomBytes } from "node:crypto";
4
4
  //#region src/homecom/custom-actions.ts
5
5
  var homeComActions = defineCustomActions({
package/dist/shc/addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
5
- const require_dist = require("../dist-CIIror0W.js");
5
+ const require_dist = require("../dist-CWtMn1_5.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  let node_https = require("node:https");
8
8
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, b as errMsg, c as deviceAdoptionCapability, f as heatingValveCapability, g as temperatureSensorCapability, h as switchCapability, i as batteryCapability, k as number, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, y as DeviceType } from "../dist-DNznrlG_.mjs";
1
+ import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, b as errMsg, c as deviceAdoptionCapability, f as heatingValveCapability, g as temperatureSensorCapability, h as switchCapability, i as batteryCapability, k as number, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, y as DeviceType } from "../dist-CWrnWIxD.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { request } from "node:https";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-bosch",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Bosch smart-home device-provider addons for CamStack — SHC, Home Connect, and HomeCom cloud integrations (scaffold)",
5
5
  "keywords": [
6
6
  "camstack",