@camstack/addon-provider-bosch 0.0.0-stage → 0.1.1
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/assets/bosch-home-connect/icon.png +0 -0
- package/assets/bosch-homecom/icon.png +0 -0
- package/assets/bosch-shc/icon.png +0 -0
- package/dist/account-integration-offline-CH7JBu8l.mjs +39 -0
- package/dist/account-integration-offline-Cbixus9v.js +50 -0
- package/dist/dist-CY6qHAEx.mjs +79003 -0
- package/dist/dist-QXDYCZIL.js +79164 -0
- package/dist/home-connect/addon.js +1624 -0
- package/dist/home-connect/addon.mjs +1623 -0
- package/dist/homecom/addon.js +1117 -0
- package/dist/homecom/addon.mjs +1116 -0
- package/dist/index.js +7 -0
- package/dist/index.mjs +4 -0
- package/dist/shc/addon.js +23733 -0
- package/dist/shc/addon.mjs +23734 -0
- package/i18n/en.json +5 -0
- package/i18n/it.json +5 -0
- package/package.json +137 -4
- package/README.md +0 -3
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { p as errMsg } from "./dist-CY6qHAEx.mjs";
|
|
2
|
+
//#region src/shared/account-integration-cascade.ts
|
|
3
|
+
async function cascadeRemoveDevicesForIntegration(input) {
|
|
4
|
+
const { reg, devices, addonId, system, integrationId, logger } = input;
|
|
5
|
+
let removed = 0;
|
|
6
|
+
for (const d of reg.getAllForAddon(addonId)) {
|
|
7
|
+
if (d.parentDeviceId !== null) continue;
|
|
8
|
+
const cfg = await devices.loadConfig(d.id).catch(() => ({}));
|
|
9
|
+
if (cfg["system"] !== system || cfg["brokerId"] !== integrationId) continue;
|
|
10
|
+
try {
|
|
11
|
+
await devices.remove(d.id);
|
|
12
|
+
removed += 1;
|
|
13
|
+
} catch (err) {
|
|
14
|
+
logger.warn(`${system}: integration cascade-remove failed`, {
|
|
15
|
+
tags: { deviceId: d.id },
|
|
16
|
+
meta: {
|
|
17
|
+
integrationId,
|
|
18
|
+
error: errMsg(err)
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return removed;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/shared/account-integration-offline.ts
|
|
27
|
+
function setIntegrationDevicesOnline(devices, system, integrationId, online) {
|
|
28
|
+
let count = 0;
|
|
29
|
+
for (const dev of devices) {
|
|
30
|
+
if (dev.config.get("system") !== system) continue;
|
|
31
|
+
if (dev.config.get("brokerId") !== integrationId) continue;
|
|
32
|
+
if (dev.online === online) continue;
|
|
33
|
+
dev.markOnline(online);
|
|
34
|
+
count += 1;
|
|
35
|
+
}
|
|
36
|
+
return count;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { cascadeRemoveDevicesForIntegration as n, setIntegrationDevicesOnline as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const require_dist = require("./dist-QXDYCZIL.js");
|
|
2
|
+
//#region src/shared/account-integration-cascade.ts
|
|
3
|
+
async function cascadeRemoveDevicesForIntegration(input) {
|
|
4
|
+
const { reg, devices, addonId, system, integrationId, logger } = input;
|
|
5
|
+
let removed = 0;
|
|
6
|
+
for (const d of reg.getAllForAddon(addonId)) {
|
|
7
|
+
if (d.parentDeviceId !== null) continue;
|
|
8
|
+
const cfg = await devices.loadConfig(d.id).catch(() => ({}));
|
|
9
|
+
if (cfg["system"] !== system || cfg["brokerId"] !== integrationId) continue;
|
|
10
|
+
try {
|
|
11
|
+
await devices.remove(d.id);
|
|
12
|
+
removed += 1;
|
|
13
|
+
} catch (err) {
|
|
14
|
+
logger.warn(`${system}: integration cascade-remove failed`, {
|
|
15
|
+
tags: { deviceId: d.id },
|
|
16
|
+
meta: {
|
|
17
|
+
integrationId,
|
|
18
|
+
error: require_dist.errMsg(err)
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return removed;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/shared/account-integration-offline.ts
|
|
27
|
+
function setIntegrationDevicesOnline(devices, system, integrationId, online) {
|
|
28
|
+
let count = 0;
|
|
29
|
+
for (const dev of devices) {
|
|
30
|
+
if (dev.config.get("system") !== system) continue;
|
|
31
|
+
if (dev.config.get("brokerId") !== integrationId) continue;
|
|
32
|
+
if (dev.online === online) continue;
|
|
33
|
+
dev.markOnline(online);
|
|
34
|
+
count += 1;
|
|
35
|
+
}
|
|
36
|
+
return count;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
Object.defineProperty(exports, "cascadeRemoveDevicesForIntegration", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function() {
|
|
42
|
+
return cascadeRemoveDevicesForIntegration;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "setIntegrationDevicesOnline", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function() {
|
|
48
|
+
return setIntegrationDevicesOnline;
|
|
49
|
+
}
|
|
50
|
+
});
|