@camstack/addon-provider-bosch 0.1.40 → 0.1.41
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/CHANGELOG.md +6 -0
- package/README.md +3 -3
- package/dist/{account-integration-offline-DTnyqayb.mjs → account-integration-offline-B0GiHxM5.mjs} +1 -1
- package/dist/{account-integration-offline-DwgBg38i.js → account-integration-offline-bVxt6lq-.js} +1 -1
- package/dist/{bosch-instances-Yqi-WAZN.mjs → bosch-instances-C1zZd1KP.mjs} +760 -914
- package/dist/{bosch-instances-DEH7DYwo.js → bosch-instances-CNLo570R.js} +755 -915
- package/dist/home-connect/addon.js +35 -43
- package/dist/home-connect/addon.mjs +35 -43
- package/dist/homecom/addon.js +46 -54
- package/dist/homecom/addon.mjs +46 -54
- package/dist/shc/addon.js +20 -28
- package/dist/shc/addon.mjs +20 -28
- package/package.json +2 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_bosch_instances = require("../bosch-instances-
|
|
3
|
-
const require_account_integration_offline = require("../account-integration-offline-
|
|
2
|
+
const require_bosch_instances = require("../bosch-instances-CNLo570R.js");
|
|
3
|
+
const require_account_integration_offline = require("../account-integration-offline-bVxt6lq-.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
let node_tls = require("node:tls");
|
|
6
6
|
let node_zlib = require("node:zlib");
|
|
@@ -3619,48 +3619,44 @@ var HomeConnectClientRegistry = class {
|
|
|
3619
3619
|
};
|
|
3620
3620
|
//#endregion
|
|
3621
3621
|
//#region src/home-connect/home-connect-connection-test.ts
|
|
3622
|
-
var TEST_LABEL = "Checks the Home Connect account token and lists appliances";
|
|
3623
3622
|
function buildHomeConnectConnectionTestProvider(deps) {
|
|
3624
3623
|
const { logger } = deps;
|
|
3625
|
-
return {
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3624
|
+
return { testSettings: async ({ settings }) => {
|
|
3625
|
+
const parsed = connectionFromSettings(typeof settings === "object" && settings !== null ? Object.fromEntries(Object.entries(settings)) : {});
|
|
3626
|
+
if (parsed === null) return {
|
|
3627
|
+
outcome: "rejected",
|
|
3628
|
+
error: "Home Connect settings incomplete: sign in to read the account token."
|
|
3629
|
+
};
|
|
3630
|
+
const saved = parsed.appliances ?? [];
|
|
3631
|
+
if (saved.length > 0) {
|
|
3632
|
+
const names = saved.map((app) => app.name).join(", ");
|
|
3633
|
+
return {
|
|
3634
|
+
outcome: "validated",
|
|
3635
|
+
latencyMs: 0,
|
|
3636
|
+
detail: names.length > 0 ? names : `${String(saved.length)} appliance(s) on this account`
|
|
3637
|
+
};
|
|
3638
|
+
}
|
|
3639
|
+
const startedAt = Date.now();
|
|
3640
|
+
try {
|
|
3641
|
+
const account = await fetchHomeConnectAccount(parsed, deps.fetchImpl);
|
|
3642
|
+
return {
|
|
3643
|
+
outcome: "validated",
|
|
3644
|
+
latencyMs: Date.now() - startedAt,
|
|
3645
|
+
detail: account.summary
|
|
3646
|
+
};
|
|
3647
|
+
} catch (err) {
|
|
3648
|
+
const message = require_bosch_instances.errMsg(err);
|
|
3649
|
+
if (message.includes("rejected")) return {
|
|
3630
3650
|
outcome: "rejected",
|
|
3631
|
-
error: "Home Connect
|
|
3651
|
+
error: "Home Connect refused this account token. Sign in again."
|
|
3652
|
+
};
|
|
3653
|
+
logger.warn("Home Connect account test inconclusive", { meta: { error: message } });
|
|
3654
|
+
return {
|
|
3655
|
+
outcome: "inconclusive",
|
|
3656
|
+
error: "Could not reach Home Connect to read this account."
|
|
3632
3657
|
};
|
|
3633
|
-
const saved = parsed.appliances ?? [];
|
|
3634
|
-
if (saved.length > 0) {
|
|
3635
|
-
const names = saved.map((app) => app.name).join(", ");
|
|
3636
|
-
return {
|
|
3637
|
-
outcome: "validated",
|
|
3638
|
-
latencyMs: 0,
|
|
3639
|
-
detail: names.length > 0 ? names : `${String(saved.length)} appliance(s) on this account`
|
|
3640
|
-
};
|
|
3641
|
-
}
|
|
3642
|
-
const startedAt = Date.now();
|
|
3643
|
-
try {
|
|
3644
|
-
const account = await fetchHomeConnectAccount(parsed, deps.fetchImpl);
|
|
3645
|
-
return {
|
|
3646
|
-
outcome: "validated",
|
|
3647
|
-
latencyMs: Date.now() - startedAt,
|
|
3648
|
-
detail: account.summary
|
|
3649
|
-
};
|
|
3650
|
-
} catch (err) {
|
|
3651
|
-
const message = require_bosch_instances.errMsg(err);
|
|
3652
|
-
if (message.includes("rejected")) return {
|
|
3653
|
-
outcome: "rejected",
|
|
3654
|
-
error: "Home Connect refused this account token. Sign in again."
|
|
3655
|
-
};
|
|
3656
|
-
logger.warn("Home Connect account test inconclusive", { meta: { error: message } });
|
|
3657
|
-
return {
|
|
3658
|
-
outcome: "inconclusive",
|
|
3659
|
-
error: "Could not reach Home Connect to read this account."
|
|
3660
|
-
};
|
|
3661
|
-
}
|
|
3662
3658
|
}
|
|
3663
|
-
};
|
|
3659
|
+
} };
|
|
3664
3660
|
}
|
|
3665
3661
|
//#endregion
|
|
3666
3662
|
//#region src/home-connect/home-connect-connection-persist.ts
|
|
@@ -5418,10 +5414,6 @@ var BoschHomeConnectProviderAddon = class extends require_bosch_instances.BaseDe
|
|
|
5418
5414
|
capability: require_bosch_instances.deviceAdoptionCapability,
|
|
5419
5415
|
provider: this.buildAdoptionProvider()
|
|
5420
5416
|
},
|
|
5421
|
-
{
|
|
5422
|
-
capability: require_bosch_instances.connectionTestCapability,
|
|
5423
|
-
provider: this.buildConnectionTestProvider()
|
|
5424
|
-
},
|
|
5425
5417
|
{
|
|
5426
5418
|
capability: require_bosch_instances.integrationInstancesCapability,
|
|
5427
5419
|
provider: built.provider
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as createSignInAttemptStore, i as openSignInProxy, n as cascadeRemoveDevicesForIntegration, o as loginFailureForAttempt, r as createSignInClaims, s as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-
|
|
1
|
+
import { A as RecordIntegrationInstances, B as array, C as powerMeterCapability, E as runningStateCapability, F as entryBody, G as record, H as literal, I as isSecretMarker, J as unknown, K as string, L as isSecretMarkerLike, M as customAction, N as defineCustomActions, P as defineEntryKind, Q as EventCategory, R as rowsDepsOver, S as numericSensorCapability, T as runningFromDishwasherOperation, V as boolean, W as object, X as DeviceType, Y as DeviceRole, Z as errMsg, _ as enumSensorCapability, a as BaseDevice, b as ingestReading, c as RUNNING_STATE_COLD, f as binaryCapability, g as dishwasherCapability, h as deviceAdoptionCapability, i as testBoschInstance, j as createEvent, m as consumablesCapability, n as boschRowsPorts, o as BaseDeviceProvider, q as union, r as keepBodyKeys, s as DishwasherOperationStateSchema, t as boschRowsMigration, u as VendorLoginProxy, v as eventEmitterCapability, w as quantityFromUnit, x as integrationInstancesCapability, z as _enum } from "../bosch-instances-C1zZd1KP.mjs";
|
|
2
|
+
import { a as createSignInAttemptStore, i as openSignInProxy, n as cascadeRemoveDevicesForIntegration, o as loginFailureForAttempt, r as createSignInClaims, s as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-B0GiHxM5.mjs";
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
import { connect } from "node:tls";
|
|
5
5
|
import { inflateRawSync } from "node:zlib";
|
|
@@ -3618,48 +3618,44 @@ var HomeConnectClientRegistry = class {
|
|
|
3618
3618
|
};
|
|
3619
3619
|
//#endregion
|
|
3620
3620
|
//#region src/home-connect/home-connect-connection-test.ts
|
|
3621
|
-
var TEST_LABEL = "Checks the Home Connect account token and lists appliances";
|
|
3622
3621
|
function buildHomeConnectConnectionTestProvider(deps) {
|
|
3623
3622
|
const { logger } = deps;
|
|
3624
|
-
return {
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3623
|
+
return { testSettings: async ({ settings }) => {
|
|
3624
|
+
const parsed = connectionFromSettings(typeof settings === "object" && settings !== null ? Object.fromEntries(Object.entries(settings)) : {});
|
|
3625
|
+
if (parsed === null) return {
|
|
3626
|
+
outcome: "rejected",
|
|
3627
|
+
error: "Home Connect settings incomplete: sign in to read the account token."
|
|
3628
|
+
};
|
|
3629
|
+
const saved = parsed.appliances ?? [];
|
|
3630
|
+
if (saved.length > 0) {
|
|
3631
|
+
const names = saved.map((app) => app.name).join(", ");
|
|
3632
|
+
return {
|
|
3633
|
+
outcome: "validated",
|
|
3634
|
+
latencyMs: 0,
|
|
3635
|
+
detail: names.length > 0 ? names : `${String(saved.length)} appliance(s) on this account`
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
const startedAt = Date.now();
|
|
3639
|
+
try {
|
|
3640
|
+
const account = await fetchHomeConnectAccount(parsed, deps.fetchImpl);
|
|
3641
|
+
return {
|
|
3642
|
+
outcome: "validated",
|
|
3643
|
+
latencyMs: Date.now() - startedAt,
|
|
3644
|
+
detail: account.summary
|
|
3645
|
+
};
|
|
3646
|
+
} catch (err) {
|
|
3647
|
+
const message = errMsg(err);
|
|
3648
|
+
if (message.includes("rejected")) return {
|
|
3629
3649
|
outcome: "rejected",
|
|
3630
|
-
error: "Home Connect
|
|
3650
|
+
error: "Home Connect refused this account token. Sign in again."
|
|
3651
|
+
};
|
|
3652
|
+
logger.warn("Home Connect account test inconclusive", { meta: { error: message } });
|
|
3653
|
+
return {
|
|
3654
|
+
outcome: "inconclusive",
|
|
3655
|
+
error: "Could not reach Home Connect to read this account."
|
|
3631
3656
|
};
|
|
3632
|
-
const saved = parsed.appliances ?? [];
|
|
3633
|
-
if (saved.length > 0) {
|
|
3634
|
-
const names = saved.map((app) => app.name).join(", ");
|
|
3635
|
-
return {
|
|
3636
|
-
outcome: "validated",
|
|
3637
|
-
latencyMs: 0,
|
|
3638
|
-
detail: names.length > 0 ? names : `${String(saved.length)} appliance(s) on this account`
|
|
3639
|
-
};
|
|
3640
|
-
}
|
|
3641
|
-
const startedAt = Date.now();
|
|
3642
|
-
try {
|
|
3643
|
-
const account = await fetchHomeConnectAccount(parsed, deps.fetchImpl);
|
|
3644
|
-
return {
|
|
3645
|
-
outcome: "validated",
|
|
3646
|
-
latencyMs: Date.now() - startedAt,
|
|
3647
|
-
detail: account.summary
|
|
3648
|
-
};
|
|
3649
|
-
} catch (err) {
|
|
3650
|
-
const message = errMsg(err);
|
|
3651
|
-
if (message.includes("rejected")) return {
|
|
3652
|
-
outcome: "rejected",
|
|
3653
|
-
error: "Home Connect refused this account token. Sign in again."
|
|
3654
|
-
};
|
|
3655
|
-
logger.warn("Home Connect account test inconclusive", { meta: { error: message } });
|
|
3656
|
-
return {
|
|
3657
|
-
outcome: "inconclusive",
|
|
3658
|
-
error: "Could not reach Home Connect to read this account."
|
|
3659
|
-
};
|
|
3660
|
-
}
|
|
3661
3657
|
}
|
|
3662
|
-
};
|
|
3658
|
+
} };
|
|
3663
3659
|
}
|
|
3664
3660
|
//#endregion
|
|
3665
3661
|
//#region src/home-connect/home-connect-connection-persist.ts
|
|
@@ -5417,10 +5413,6 @@ var BoschHomeConnectProviderAddon = class extends BaseDeviceProvider {
|
|
|
5417
5413
|
capability: deviceAdoptionCapability,
|
|
5418
5414
|
provider: this.buildAdoptionProvider()
|
|
5419
5415
|
},
|
|
5420
|
-
{
|
|
5421
|
-
capability: connectionTestCapability,
|
|
5422
|
-
provider: this.buildConnectionTestProvider()
|
|
5423
|
-
},
|
|
5424
5416
|
{
|
|
5425
5417
|
capability: integrationInstancesCapability,
|
|
5426
5418
|
provider: built.provider
|
package/dist/homecom/addon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_bosch_instances = require("../bosch-instances-
|
|
3
|
-
const require_account_integration_offline = require("../account-integration-offline-
|
|
2
|
+
const require_bosch_instances = require("../bosch-instances-CNLo570R.js");
|
|
3
|
+
const require_account_integration_offline = require("../account-integration-offline-bVxt6lq-.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
//#region src/homecom/config.ts
|
|
6
6
|
var HOMECOM_BRANDS = ["bosch", "buderus"];
|
|
@@ -1796,7 +1796,6 @@ var HomeComClientRegistry = class {
|
|
|
1796
1796
|
};
|
|
1797
1797
|
//#endregion
|
|
1798
1798
|
//#region src/homecom/homecom-connection-test.ts
|
|
1799
|
-
var TEST_LABEL = "Lists the account gateways and reads the gateway clock";
|
|
1800
1799
|
var NO_GATEWAY = "This Bosch account has no HomeCom gateway.";
|
|
1801
1800
|
function signInIncomplete(paths) {
|
|
1802
1801
|
if (paths.includes("token") || paths.includes("refresh")) return "Sign in first. Bosch has not issued an access token yet.";
|
|
@@ -1811,56 +1810,53 @@ function listFailureMessage(err) {
|
|
|
1811
1810
|
function buildHomeComConnectionTestProvider(deps) {
|
|
1812
1811
|
const { logger } = deps;
|
|
1813
1812
|
const makeClient = deps.makeClient ?? ((config, gatewayId) => createHomeComApiClient(config, gatewayId, { refreshOnUnauthorized: false }));
|
|
1814
|
-
return {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1813
|
+
return { testSettings: async ({ settings }) => {
|
|
1814
|
+
const parsed = homeComConfigSchema.safeParse(settings);
|
|
1815
|
+
if (!parsed.success) return {
|
|
1816
|
+
outcome: "rejected",
|
|
1817
|
+
error: signInIncomplete(parsed.error.issues.map((issue) => issue.path.join(".") || "(root)"))
|
|
1818
|
+
};
|
|
1819
|
+
const startedAt = Date.now();
|
|
1820
|
+
try {
|
|
1821
|
+
const gateways = await makeClient(parsed.data, "").listGateways();
|
|
1822
|
+
const gatewayId = parsed.data.gatewayId ?? gateways[0]?.gatewayId;
|
|
1823
|
+
if (gatewayId === void 0) return {
|
|
1819
1824
|
outcome: "rejected",
|
|
1820
|
-
error:
|
|
1825
|
+
error: NO_GATEWAY
|
|
1826
|
+
};
|
|
1827
|
+
if (!gateways.some((g) => g.gatewayId === gatewayId)) return {
|
|
1828
|
+
outcome: "rejected",
|
|
1829
|
+
error: `Gateway ${gatewayId} is not on this account.`
|
|
1830
|
+
};
|
|
1831
|
+
const listed = gateways.find((gateway) => gateway.gatewayId === gatewayId);
|
|
1832
|
+
const probe = await makeClient(parsed.data, gatewayId).probeGateway();
|
|
1833
|
+
const refusal = unsupportedDeviceTypeMessage(listed?.deviceType);
|
|
1834
|
+
if (refusal !== null) return {
|
|
1835
|
+
outcome: "rejected",
|
|
1836
|
+
error: refusal
|
|
1837
|
+
};
|
|
1838
|
+
return {
|
|
1839
|
+
outcome: "validated",
|
|
1840
|
+
latencyMs: Date.now() - startedAt,
|
|
1841
|
+
detail: `Gateway ${gatewayId} (${listed?.deviceType}) answered ${probe.resource}.`
|
|
1842
|
+
};
|
|
1843
|
+
} catch (err) {
|
|
1844
|
+
const listed = listFailureMessage(err);
|
|
1845
|
+
if (listed !== null) return {
|
|
1846
|
+
outcome: "rejected",
|
|
1847
|
+
error: listed
|
|
1848
|
+
};
|
|
1849
|
+
if (err instanceof HomeComAuthError) return {
|
|
1850
|
+
outcome: "rejected",
|
|
1851
|
+
error: "HomeCom refused the access token — sign in again to get a fresh one."
|
|
1852
|
+
};
|
|
1853
|
+
logger.warn("HomeCom connection test inconclusive", { meta: { error: require_bosch_instances.errMsg(err) } });
|
|
1854
|
+
return {
|
|
1855
|
+
outcome: "inconclusive",
|
|
1856
|
+
error: "Could not reach the HomeCom cloud API."
|
|
1821
1857
|
};
|
|
1822
|
-
const startedAt = Date.now();
|
|
1823
|
-
try {
|
|
1824
|
-
const gateways = await makeClient(parsed.data, "").listGateways();
|
|
1825
|
-
const gatewayId = parsed.data.gatewayId ?? gateways[0]?.gatewayId;
|
|
1826
|
-
if (gatewayId === void 0) return {
|
|
1827
|
-
outcome: "rejected",
|
|
1828
|
-
error: NO_GATEWAY
|
|
1829
|
-
};
|
|
1830
|
-
if (!gateways.some((g) => g.gatewayId === gatewayId)) return {
|
|
1831
|
-
outcome: "rejected",
|
|
1832
|
-
error: `Gateway ${gatewayId} is not on this account.`
|
|
1833
|
-
};
|
|
1834
|
-
const listed = gateways.find((gateway) => gateway.gatewayId === gatewayId);
|
|
1835
|
-
const probe = await makeClient(parsed.data, gatewayId).probeGateway();
|
|
1836
|
-
const refusal = unsupportedDeviceTypeMessage(listed?.deviceType);
|
|
1837
|
-
if (refusal !== null) return {
|
|
1838
|
-
outcome: "rejected",
|
|
1839
|
-
error: refusal
|
|
1840
|
-
};
|
|
1841
|
-
return {
|
|
1842
|
-
outcome: "validated",
|
|
1843
|
-
latencyMs: Date.now() - startedAt,
|
|
1844
|
-
detail: `Gateway ${gatewayId} (${listed?.deviceType}) answered ${probe.resource}.`
|
|
1845
|
-
};
|
|
1846
|
-
} catch (err) {
|
|
1847
|
-
const listed = listFailureMessage(err);
|
|
1848
|
-
if (listed !== null) return {
|
|
1849
|
-
outcome: "rejected",
|
|
1850
|
-
error: listed
|
|
1851
|
-
};
|
|
1852
|
-
if (err instanceof HomeComAuthError) return {
|
|
1853
|
-
outcome: "rejected",
|
|
1854
|
-
error: "HomeCom refused the access token — sign in again to get a fresh one."
|
|
1855
|
-
};
|
|
1856
|
-
logger.warn("HomeCom connection test inconclusive", { meta: { error: require_bosch_instances.errMsg(err) } });
|
|
1857
|
-
return {
|
|
1858
|
-
outcome: "inconclusive",
|
|
1859
|
-
error: "Could not reach the HomeCom cloud API."
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
1858
|
}
|
|
1863
|
-
};
|
|
1859
|
+
} };
|
|
1864
1860
|
}
|
|
1865
1861
|
//#endregion
|
|
1866
1862
|
//#region src/homecom/homecom-instances.ts
|
|
@@ -2233,10 +2229,6 @@ var BoschHomeComProviderAddon = class extends require_bosch_instances.BaseDevice
|
|
|
2233
2229
|
capability: require_bosch_instances.deviceAdoptionCapability,
|
|
2234
2230
|
provider: this.buildAdoptionProvider()
|
|
2235
2231
|
},
|
|
2236
|
-
{
|
|
2237
|
-
capability: require_bosch_instances.connectionTestCapability,
|
|
2238
|
-
provider: this.buildConnectionTestProvider()
|
|
2239
|
-
},
|
|
2240
2232
|
{
|
|
2241
2233
|
capability: require_bosch_instances.integrationInstancesCapability,
|
|
2242
2234
|
provider: built.provider
|
package/dist/homecom/addon.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as createSignInAttemptStore, i as openSignInProxy, n as cascadeRemoveDevicesForIntegration, o as loginFailureForAttempt, r as createSignInClaims, s as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-
|
|
1
|
+
import { A as RecordIntegrationInstances, B as array, F as entryBody, H as literal, K as string, M as customAction, N as defineCustomActions, P as defineEntryKind, Q as EventCategory, R as rowsDepsOver, U as number, V as boolean, W as object, X as DeviceType, Z as errMsg, a as BaseDevice, h as deviceAdoptionCapability, i as testBoschInstance, k as waterHeaterCapability, n as boschRowsPorts, o as BaseDeviceProvider, p as climateControlCapability, r as keepBodyKeys, t as boschRowsMigration, u as VendorLoginProxy, x as integrationInstancesCapability, z as _enum } from "../bosch-instances-C1zZd1KP.mjs";
|
|
2
|
+
import { a as createSignInAttemptStore, i as openSignInProxy, n as cascadeRemoveDevicesForIntegration, o as loginFailureForAttempt, r as createSignInClaims, s as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-B0GiHxM5.mjs";
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
//#region src/homecom/config.ts
|
|
5
5
|
var HOMECOM_BRANDS = ["bosch", "buderus"];
|
|
@@ -1795,7 +1795,6 @@ var HomeComClientRegistry = class {
|
|
|
1795
1795
|
};
|
|
1796
1796
|
//#endregion
|
|
1797
1797
|
//#region src/homecom/homecom-connection-test.ts
|
|
1798
|
-
var TEST_LABEL = "Lists the account gateways and reads the gateway clock";
|
|
1799
1798
|
var NO_GATEWAY = "This Bosch account has no HomeCom gateway.";
|
|
1800
1799
|
function signInIncomplete(paths) {
|
|
1801
1800
|
if (paths.includes("token") || paths.includes("refresh")) return "Sign in first. Bosch has not issued an access token yet.";
|
|
@@ -1810,56 +1809,53 @@ function listFailureMessage(err) {
|
|
|
1810
1809
|
function buildHomeComConnectionTestProvider(deps) {
|
|
1811
1810
|
const { logger } = deps;
|
|
1812
1811
|
const makeClient = deps.makeClient ?? ((config, gatewayId) => createHomeComApiClient(config, gatewayId, { refreshOnUnauthorized: false }));
|
|
1813
|
-
return {
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1812
|
+
return { testSettings: async ({ settings }) => {
|
|
1813
|
+
const parsed = homeComConfigSchema.safeParse(settings);
|
|
1814
|
+
if (!parsed.success) return {
|
|
1815
|
+
outcome: "rejected",
|
|
1816
|
+
error: signInIncomplete(parsed.error.issues.map((issue) => issue.path.join(".") || "(root)"))
|
|
1817
|
+
};
|
|
1818
|
+
const startedAt = Date.now();
|
|
1819
|
+
try {
|
|
1820
|
+
const gateways = await makeClient(parsed.data, "").listGateways();
|
|
1821
|
+
const gatewayId = parsed.data.gatewayId ?? gateways[0]?.gatewayId;
|
|
1822
|
+
if (gatewayId === void 0) return {
|
|
1818
1823
|
outcome: "rejected",
|
|
1819
|
-
error:
|
|
1824
|
+
error: NO_GATEWAY
|
|
1825
|
+
};
|
|
1826
|
+
if (!gateways.some((g) => g.gatewayId === gatewayId)) return {
|
|
1827
|
+
outcome: "rejected",
|
|
1828
|
+
error: `Gateway ${gatewayId} is not on this account.`
|
|
1829
|
+
};
|
|
1830
|
+
const listed = gateways.find((gateway) => gateway.gatewayId === gatewayId);
|
|
1831
|
+
const probe = await makeClient(parsed.data, gatewayId).probeGateway();
|
|
1832
|
+
const refusal = unsupportedDeviceTypeMessage(listed?.deviceType);
|
|
1833
|
+
if (refusal !== null) return {
|
|
1834
|
+
outcome: "rejected",
|
|
1835
|
+
error: refusal
|
|
1836
|
+
};
|
|
1837
|
+
return {
|
|
1838
|
+
outcome: "validated",
|
|
1839
|
+
latencyMs: Date.now() - startedAt,
|
|
1840
|
+
detail: `Gateway ${gatewayId} (${listed?.deviceType}) answered ${probe.resource}.`
|
|
1841
|
+
};
|
|
1842
|
+
} catch (err) {
|
|
1843
|
+
const listed = listFailureMessage(err);
|
|
1844
|
+
if (listed !== null) return {
|
|
1845
|
+
outcome: "rejected",
|
|
1846
|
+
error: listed
|
|
1847
|
+
};
|
|
1848
|
+
if (err instanceof HomeComAuthError) return {
|
|
1849
|
+
outcome: "rejected",
|
|
1850
|
+
error: "HomeCom refused the access token — sign in again to get a fresh one."
|
|
1851
|
+
};
|
|
1852
|
+
logger.warn("HomeCom connection test inconclusive", { meta: { error: errMsg(err) } });
|
|
1853
|
+
return {
|
|
1854
|
+
outcome: "inconclusive",
|
|
1855
|
+
error: "Could not reach the HomeCom cloud API."
|
|
1820
1856
|
};
|
|
1821
|
-
const startedAt = Date.now();
|
|
1822
|
-
try {
|
|
1823
|
-
const gateways = await makeClient(parsed.data, "").listGateways();
|
|
1824
|
-
const gatewayId = parsed.data.gatewayId ?? gateways[0]?.gatewayId;
|
|
1825
|
-
if (gatewayId === void 0) return {
|
|
1826
|
-
outcome: "rejected",
|
|
1827
|
-
error: NO_GATEWAY
|
|
1828
|
-
};
|
|
1829
|
-
if (!gateways.some((g) => g.gatewayId === gatewayId)) return {
|
|
1830
|
-
outcome: "rejected",
|
|
1831
|
-
error: `Gateway ${gatewayId} is not on this account.`
|
|
1832
|
-
};
|
|
1833
|
-
const listed = gateways.find((gateway) => gateway.gatewayId === gatewayId);
|
|
1834
|
-
const probe = await makeClient(parsed.data, gatewayId).probeGateway();
|
|
1835
|
-
const refusal = unsupportedDeviceTypeMessage(listed?.deviceType);
|
|
1836
|
-
if (refusal !== null) return {
|
|
1837
|
-
outcome: "rejected",
|
|
1838
|
-
error: refusal
|
|
1839
|
-
};
|
|
1840
|
-
return {
|
|
1841
|
-
outcome: "validated",
|
|
1842
|
-
latencyMs: Date.now() - startedAt,
|
|
1843
|
-
detail: `Gateway ${gatewayId} (${listed?.deviceType}) answered ${probe.resource}.`
|
|
1844
|
-
};
|
|
1845
|
-
} catch (err) {
|
|
1846
|
-
const listed = listFailureMessage(err);
|
|
1847
|
-
if (listed !== null) return {
|
|
1848
|
-
outcome: "rejected",
|
|
1849
|
-
error: listed
|
|
1850
|
-
};
|
|
1851
|
-
if (err instanceof HomeComAuthError) return {
|
|
1852
|
-
outcome: "rejected",
|
|
1853
|
-
error: "HomeCom refused the access token — sign in again to get a fresh one."
|
|
1854
|
-
};
|
|
1855
|
-
logger.warn("HomeCom connection test inconclusive", { meta: { error: errMsg(err) } });
|
|
1856
|
-
return {
|
|
1857
|
-
outcome: "inconclusive",
|
|
1858
|
-
error: "Could not reach the HomeCom cloud API."
|
|
1859
|
-
};
|
|
1860
|
-
}
|
|
1861
1857
|
}
|
|
1862
|
-
};
|
|
1858
|
+
} };
|
|
1863
1859
|
}
|
|
1864
1860
|
//#endregion
|
|
1865
1861
|
//#region src/homecom/homecom-instances.ts
|
|
@@ -2232,10 +2228,6 @@ var BoschHomeComProviderAddon = class extends BaseDeviceProvider {
|
|
|
2232
2228
|
capability: deviceAdoptionCapability,
|
|
2233
2229
|
provider: this.buildAdoptionProvider()
|
|
2234
2230
|
},
|
|
2235
|
-
{
|
|
2236
|
-
capability: connectionTestCapability,
|
|
2237
|
-
provider: this.buildConnectionTestProvider()
|
|
2238
|
-
},
|
|
2239
2231
|
{
|
|
2240
2232
|
capability: integrationInstancesCapability,
|
|
2241
2233
|
provider: built.provider
|
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_bosch_instances = require("../bosch-instances-
|
|
5
|
+
const require_bosch_instances = require("../bosch-instances-CNLo570R.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");
|
|
@@ -23730,34 +23730,30 @@ var ShcClientRegistry = class {
|
|
|
23730
23730
|
//#region src/shc/shc-connection-test.ts
|
|
23731
23731
|
/** REST port of a Smart Home Controller. A connect here means the address answers. */
|
|
23732
23732
|
var SHC_REACHABILITY_PORT = 8444;
|
|
23733
|
-
var TEST_LABEL = "Checks that the controller address answers on the local network";
|
|
23734
23733
|
function buildShcConnectionTestProvider(deps) {
|
|
23735
23734
|
const { logger, probe = probeTcp } = deps;
|
|
23736
|
-
return {
|
|
23737
|
-
|
|
23738
|
-
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
23742
|
-
|
|
23743
|
-
|
|
23744
|
-
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
port: SHC_REACHABILITY_PORT
|
|
23749
|
-
} });
|
|
23750
|
-
return {
|
|
23751
|
-
outcome: "rejected",
|
|
23752
|
-
error: `Could not reach ${host} on port ${SHC_REACHABILITY_PORT}.`
|
|
23753
|
-
};
|
|
23754
|
-
}
|
|
23735
|
+
return { testSettings: async ({ settings }) => {
|
|
23736
|
+
const host = readHost(settings);
|
|
23737
|
+
if (host === null) return {
|
|
23738
|
+
outcome: "rejected",
|
|
23739
|
+
error: "Enter the controller host or IP address."
|
|
23740
|
+
};
|
|
23741
|
+
const startedAt = Date.now();
|
|
23742
|
+
if (!await probe(host, 8444)) {
|
|
23743
|
+
logger.warn("Bosch SHC connection test: host unreachable", { meta: {
|
|
23744
|
+
host,
|
|
23745
|
+
port: SHC_REACHABILITY_PORT
|
|
23746
|
+
} });
|
|
23755
23747
|
return {
|
|
23756
|
-
outcome: "
|
|
23757
|
-
|
|
23748
|
+
outcome: "rejected",
|
|
23749
|
+
error: `Could not reach ${host} on port ${SHC_REACHABILITY_PORT}.`
|
|
23758
23750
|
};
|
|
23759
23751
|
}
|
|
23760
|
-
|
|
23752
|
+
return {
|
|
23753
|
+
outcome: "validated",
|
|
23754
|
+
latencyMs: Date.now() - startedAt
|
|
23755
|
+
};
|
|
23756
|
+
} };
|
|
23761
23757
|
}
|
|
23762
23758
|
function readHost(settings) {
|
|
23763
23759
|
if (settings === null || typeof settings !== "object") return null;
|
|
@@ -23869,10 +23865,6 @@ var BoschShcProviderAddon = class extends require_bosch_instances.BaseDeviceProv
|
|
|
23869
23865
|
capability: require_bosch_instances.deviceAdoptionCapability,
|
|
23870
23866
|
provider: this.buildAdoptionProvider()
|
|
23871
23867
|
},
|
|
23872
|
-
{
|
|
23873
|
-
capability: require_bosch_instances.connectionTestCapability,
|
|
23874
|
-
provider: this.buildConnectionTestProvider()
|
|
23875
|
-
},
|
|
23876
23868
|
{
|
|
23877
23869
|
capability: require_bosch_instances.integrationInstancesCapability,
|
|
23878
23870
|
provider: built.provider
|
package/dist/shc/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as RecordIntegrationInstances, B as array, D as switchCapability, F as entryBody, H as literal, K as string, M as customAction, N as defineCustomActions, O as temperatureSensorCapability, P as defineEntryKind, Q as EventCategory, R as rowsDepsOver, U as number, W as object, X as DeviceType, Z as errMsg, a as BaseDevice, d as batteryCapability, h as deviceAdoptionCapability, i as testBoschInstance, n as boschRowsPorts, o as BaseDeviceProvider, p as climateControlCapability, r as keepBodyKeys, t as boschRowsMigration, x as integrationInstancesCapability, y as heatingValveCapability, z as _enum } from "../bosch-instances-C1zZd1KP.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { request } from "node:https";
|
|
@@ -23731,34 +23731,30 @@ var ShcClientRegistry = class {
|
|
|
23731
23731
|
//#region src/shc/shc-connection-test.ts
|
|
23732
23732
|
/** REST port of a Smart Home Controller. A connect here means the address answers. */
|
|
23733
23733
|
var SHC_REACHABILITY_PORT = 8444;
|
|
23734
|
-
var TEST_LABEL = "Checks that the controller address answers on the local network";
|
|
23735
23734
|
function buildShcConnectionTestProvider(deps) {
|
|
23736
23735
|
const { logger, probe = probeTcp } = deps;
|
|
23737
|
-
return {
|
|
23738
|
-
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
23742
|
-
|
|
23743
|
-
|
|
23744
|
-
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
port: SHC_REACHABILITY_PORT
|
|
23750
|
-
} });
|
|
23751
|
-
return {
|
|
23752
|
-
outcome: "rejected",
|
|
23753
|
-
error: `Could not reach ${host} on port ${SHC_REACHABILITY_PORT}.`
|
|
23754
|
-
};
|
|
23755
|
-
}
|
|
23736
|
+
return { testSettings: async ({ settings }) => {
|
|
23737
|
+
const host = readHost(settings);
|
|
23738
|
+
if (host === null) return {
|
|
23739
|
+
outcome: "rejected",
|
|
23740
|
+
error: "Enter the controller host or IP address."
|
|
23741
|
+
};
|
|
23742
|
+
const startedAt = Date.now();
|
|
23743
|
+
if (!await probe(host, 8444)) {
|
|
23744
|
+
logger.warn("Bosch SHC connection test: host unreachable", { meta: {
|
|
23745
|
+
host,
|
|
23746
|
+
port: SHC_REACHABILITY_PORT
|
|
23747
|
+
} });
|
|
23756
23748
|
return {
|
|
23757
|
-
outcome: "
|
|
23758
|
-
|
|
23749
|
+
outcome: "rejected",
|
|
23750
|
+
error: `Could not reach ${host} on port ${SHC_REACHABILITY_PORT}.`
|
|
23759
23751
|
};
|
|
23760
23752
|
}
|
|
23761
|
-
|
|
23753
|
+
return {
|
|
23754
|
+
outcome: "validated",
|
|
23755
|
+
latencyMs: Date.now() - startedAt
|
|
23756
|
+
};
|
|
23757
|
+
} };
|
|
23762
23758
|
}
|
|
23763
23759
|
function readHost(settings) {
|
|
23764
23760
|
if (settings === null || typeof settings !== "object") return null;
|
|
@@ -23870,10 +23866,6 @@ var BoschShcProviderAddon = class extends BaseDeviceProvider {
|
|
|
23870
23866
|
capability: deviceAdoptionCapability,
|
|
23871
23867
|
provider: this.buildAdoptionProvider()
|
|
23872
23868
|
},
|
|
23873
|
-
{
|
|
23874
|
-
capability: connectionTestCapability,
|
|
23875
|
-
provider: this.buildConnectionTestProvider()
|
|
23876
|
-
},
|
|
23877
23869
|
{
|
|
23878
23870
|
capability: integrationInstancesCapability,
|
|
23879
23871
|
provider: built.provider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-bosch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
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",
|
|
@@ -56,9 +56,6 @@
|
|
|
56
56
|
{
|
|
57
57
|
"name": "device-adoption"
|
|
58
58
|
},
|
|
59
|
-
{
|
|
60
|
-
"name": "connection-test"
|
|
61
|
-
},
|
|
62
59
|
{
|
|
63
60
|
"name": "integration-instances"
|
|
64
61
|
}
|
|
@@ -86,9 +83,6 @@
|
|
|
86
83
|
{
|
|
87
84
|
"name": "device-adoption"
|
|
88
85
|
},
|
|
89
|
-
{
|
|
90
|
-
"name": "connection-test"
|
|
91
|
-
},
|
|
92
86
|
{
|
|
93
87
|
"name": "integration-instances"
|
|
94
88
|
},
|
|
@@ -125,9 +119,6 @@
|
|
|
125
119
|
{
|
|
126
120
|
"name": "device-adoption"
|
|
127
121
|
},
|
|
128
|
-
{
|
|
129
|
-
"name": "connection-test"
|
|
130
|
-
},
|
|
131
122
|
{
|
|
132
123
|
"name": "integration-instances"
|
|
133
124
|
},
|
|
@@ -141,7 +132,7 @@
|
|
|
141
132
|
}
|
|
142
133
|
],
|
|
143
134
|
"requires": {
|
|
144
|
-
"server": ">=1.2.
|
|
135
|
+
"server": ">=1.2.787"
|
|
145
136
|
}
|
|
146
137
|
},
|
|
147
138
|
"files": [
|