iobroker.iot 5.0.11 → 5.0.13
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/LICENSE +1 -1
- package/README.md +11 -10
- package/admin/assets/index-CJ_AWUR4.css +1 -0
- package/admin/assets/index-DCr4hGKK.js +705 -0
- package/admin/index_m.html +2 -2
- package/admin/rules/@mf-types/ActionVisu.d.ts +2 -0
- package/admin/rules/@mf-types/compiled-types/ActionVisu.d.ts +29 -0
- package/admin/rules/@mf-types.d.ts +3 -0
- package/admin/rules/@mf-types.zip +0 -0
- package/admin/rules/assets/ActionVisu-BN0Kjfo9.js +5 -0
- package/admin/rules/assets/ActionVisu__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.js-D5qEIjqV.js +1 -0
- package/admin/rules/assets/ActionVisu__loadShare__react__loadShare__.js-aa1tDx2C.js +1 -0
- package/admin/rules/assets/ActionVisu__loadShare__react__loadShare__.js_commonjs-proxy-DX6cx281.js +1 -0
- package/admin/rules/assets/ActionVisu__loadShare__react_mf_2_dom__loadShare__.js-uY2qDezJ.js +1 -0
- package/admin/rules/assets/ActionVisu__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-27bLZRGy.js +1 -0
- package/admin/rules/assets/bootstrap-QjsDSZNA.js +1 -0
- package/admin/rules/assets/hostInit-CoWylRge.js +1 -0
- package/admin/rules/assets/index-C1ZEp-2N.js +2 -0
- package/admin/rules/assets/index-Ccpql4vu.js +1 -0
- package/admin/rules/assets/{index-DAfe9TMn.js → index-DiSsXjpZ.js} +4 -20
- package/admin/rules/assets/index-FrXvyqvW.js +1187 -0
- package/admin/rules/assets/jsx-runtime-CnsYFZsa.js +1 -0
- package/admin/rules/assets/localSharedImportMap-8wECk2hR.js +1 -0
- package/admin/rules/assets/virtualExposes-b6CxLzZb.js +1 -0
- package/admin/rules/customRuleBlocks.js +7 -2
- package/admin/rules/mf-stats.json +1 -0
- package/build/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js +2 -2
- package/build/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Alexa/Capabilities/EndpointHealth.js +1 -1
- package/build/lib/AlexaSmartHomeV3/Alexa/Capabilities/EndpointHealth.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Controls/Control.js +2 -2
- package/build/lib/AlexaSmartHomeV3/Controls/Control.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Device.js +3 -3
- package/build/lib/AlexaSmartHomeV3/Device.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/DeviceManager.js +2 -1
- package/build/lib/AlexaSmartHomeV3/DeviceManager.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +2 -2
- package/build/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js.map +1 -1
- package/build/lib/AlexaSmartHomeV3/Helpers/Utils.js +1 -1
- package/build/lib/AlexaSmartHomeV3/Helpers/Utils.js.map +1 -1
- package/build/lib/alisa.js +4 -4
- package/build/main.js +35 -64
- package/build/main.js.map +1 -1
- package/io-package.json +27 -27
- package/package.json +13 -14
- package/admin/assets/index-Bd3GtHgn.css +0 -1
- package/admin/assets/index-BmnNw2oA.js +0 -759
- package/admin/rules/assets/ActionVisu-BvWg4aqg.js +0 -5
- package/admin/rules/assets/ActionVisu__loadShare__react__loadShare__-5Bv9wGPU.js +0 -1
- package/admin/rules/assets/ActionVisu__loadShare__react_mf_2_dom__loadShare__-DUk47PjY.js +0 -9
- package/admin/rules/assets/ActionVisu__mf_v__runtimeInit__mf_v__-BUkKpfUR.js +0 -1
- package/admin/rules/assets/_commonjsHelpers-Cpj98o6Y.js +0 -1
- package/admin/rules/assets/bootstrap-BPw119x4.js +0 -1
- package/admin/rules/assets/hostInit-Dxp6BaAc.js +0 -2
- package/admin/rules/assets/index-Do-nCdWy.js +0 -9
- package/admin/rules/assets/index-NkHakkqA.js +0 -2
- package/admin/rules/assets/index-aJU5X-xL.js +0 -1152
- package/admin/rules/assets/index.cjs-DyuWoUPi.js +0 -8
- package/admin/rules/assets/virtualExposes-BQXgT6g9.js +0 -2
- package/build/lib/alexaSmartHomeV2.js +0 -2788
package/build/main.js
CHANGED
|
@@ -8,8 +8,6 @@ const adapter_core_1 = require("@iobroker/adapter-core"); // Get common adapter
|
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const axios_1 = __importDefault(require("axios"));
|
|
10
10
|
const node_zlib_1 = require("node:zlib");
|
|
11
|
-
// @ts-expect-error no types
|
|
12
|
-
const alexaSmartHomeV2_1 = __importDefault(require("./lib/alexaSmartHomeV2"));
|
|
13
11
|
const alexaSmartHomeV3_1 = __importDefault(require("./lib/alexaSmartHomeV3"));
|
|
14
12
|
const alexaCustom_1 = __importDefault(require("./lib/alexaCustom"));
|
|
15
13
|
// @ts-expect-error no types
|
|
@@ -37,7 +35,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
37
35
|
recalcTimeout = null;
|
|
38
36
|
lang = 'de';
|
|
39
37
|
translate = false;
|
|
40
|
-
alexaSH2 = null;
|
|
41
38
|
alexaSH3 = null;
|
|
42
39
|
googleHome = null;
|
|
43
40
|
alexaCustom = null;
|
|
@@ -49,7 +46,7 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
49
46
|
secret = '';
|
|
50
47
|
connectStarted = 0;
|
|
51
48
|
caCert = null;
|
|
52
|
-
validTill = null;
|
|
49
|
+
validTill = null; // null - never read, "--" - user has no license, ISO date string - valid till
|
|
53
50
|
validTillLastQuery = 0;
|
|
54
51
|
alertReported = false;
|
|
55
52
|
constructor(options = {}) {
|
|
@@ -63,7 +60,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
63
60
|
if (this.lang !== 'en' && this.lang !== 'de' && this.lang !== 'ru') {
|
|
64
61
|
this.lang = 'en';
|
|
65
62
|
}
|
|
66
|
-
this.alexaSH2?.setLanguage(this.lang);
|
|
67
63
|
this.alexaSH3?.setLanguage(this.lang);
|
|
68
64
|
this.yandexAlisa?.setLanguage(this.lang);
|
|
69
65
|
this.alexaCustom?.setLanguage(this.lang);
|
|
@@ -135,15 +131,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
135
131
|
}
|
|
136
132
|
this.recalcTimeout = setTimeout(async () => {
|
|
137
133
|
this.recalcTimeout = null;
|
|
138
|
-
this.alexaSH2?.updateDevices(obj.message, async (analyseAddedId) => {
|
|
139
|
-
await this.setStateAsync('smart.updatesResult', analyseAddedId || '', true);
|
|
140
|
-
this.log.debug('Devices updated!');
|
|
141
|
-
await this.setStateAsync('smart.updates', true, true);
|
|
142
|
-
});
|
|
143
|
-
// this.alexaSH3 && this.alexaSH3.updateDevices(obj.message, async analyseAddedId => {
|
|
144
|
-
// await this.setStateAsync('smart.updatesResult', analyseAddedId || '', true);
|
|
145
|
-
// await this.setStateAsync('smart.updates3', true, true);
|
|
146
|
-
// });
|
|
147
134
|
if (this.alexaSH3) {
|
|
148
135
|
await this.alexaSH3.updateDevices();
|
|
149
136
|
await this.setStateAsync('smart.updates3', 1, true);
|
|
@@ -155,20 +142,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
155
142
|
});
|
|
156
143
|
}, 1000);
|
|
157
144
|
break;
|
|
158
|
-
case 'browse':
|
|
159
|
-
if (obj.callback) {
|
|
160
|
-
this.log.info('Request devices');
|
|
161
|
-
if (this.alexaSH2) {
|
|
162
|
-
this.alexaSH2.updateDevices(() => {
|
|
163
|
-
this.sendTo(obj.from, obj.command, this.alexaSH2.getDevices(), obj.callback);
|
|
164
|
-
void this.setState('smart.updates', false, true);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
this.sendTo(obj.from, obj.command, { error: 'not activated' }, obj.callback);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
break;
|
|
172
145
|
case 'browse3':
|
|
173
146
|
if (obj.callback) {
|
|
174
147
|
this.log.info(`Request V3 devices: ${obj.message}`);
|
|
@@ -253,9 +226,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
253
226
|
case 'alexaCustomResponse':
|
|
254
227
|
this.alexaCustom?.setResponse(obj.message);
|
|
255
228
|
break;
|
|
256
|
-
case 'debug':
|
|
257
|
-
this.alexaSH2?.getDebug((data) => this.sendTo(obj.from, obj.command, data, obj.callback));
|
|
258
|
-
break;
|
|
259
229
|
case 'updateValidTill':
|
|
260
230
|
await this.readValidTill(true);
|
|
261
231
|
this.sendTo(obj.from, obj.command, this.validTill, obj.callback);
|
|
@@ -834,9 +804,6 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
834
804
|
return { error: 'Service is disabled' };
|
|
835
805
|
}
|
|
836
806
|
else {
|
|
837
|
-
if (this.alexaSH2) {
|
|
838
|
-
return this.alexaSH2.process(request, this.config.amazonAlexa);
|
|
839
|
-
}
|
|
840
807
|
return { error: 'Service is disabled' };
|
|
841
808
|
}
|
|
842
809
|
}
|
|
@@ -1063,12 +1030,16 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
1063
1030
|
this.validTill &&
|
|
1064
1031
|
this.validTillLastQuery &&
|
|
1065
1032
|
Date.now() - this.validTillLastQuery < 24 * 3_600_000) {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1033
|
+
if (this.validTill !== '--') {
|
|
1034
|
+
const validTill = new Date(this.validTill);
|
|
1035
|
+
const tomorrow = new Date();
|
|
1036
|
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
1037
|
+
if (validTill > tomorrow) {
|
|
1038
|
+
// use cached value
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1071
1041
|
}
|
|
1042
|
+
return;
|
|
1072
1043
|
}
|
|
1073
1044
|
try {
|
|
1074
1045
|
const response = await fetch('https://iobroker.pro:3001/api/v1/validTill', {
|
|
@@ -1081,25 +1052,32 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
1081
1052
|
this.validTillLastQuery = Date.now();
|
|
1082
1053
|
const data = (await response.json());
|
|
1083
1054
|
this.validTill = data.validTill;
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
const diff = validTillDate.getTime() - now.getTime();
|
|
1089
|
-
const days = Math.ceil(diff / (1000 * 3600 * 24));
|
|
1090
|
-
if (days <= 7 && !this.alertReported) {
|
|
1091
|
-
this.alertReported = true;
|
|
1092
|
-
await this.registerNotification('iot', 'subscription', validTillDate.toLocaleString());
|
|
1093
|
-
this.log.warn(`Your ioBroker IoT license will expire in ${days} day(s) on ${validTillDate.toDateString()}. Please renew your license to continue using all features without interruption.`);
|
|
1055
|
+
if (Math.abs(Date.now() - new Date(data.validTill).getTime()) < 120_000) {
|
|
1056
|
+
// User has no valid license and never had
|
|
1057
|
+
this.log.debug('You do not have any licenses.');
|
|
1058
|
+
this.validTill = '--';
|
|
1094
1059
|
}
|
|
1095
|
-
|
|
1060
|
+
else {
|
|
1061
|
+
// If license expires in less than 7 days, show warning every time adapter starts
|
|
1062
|
+
const validTillDate = new Date(data.validTill);
|
|
1063
|
+
const now = new Date();
|
|
1064
|
+
const diff = validTillDate.getTime() - now.getTime();
|
|
1065
|
+
const days = Math.ceil(diff / (1000 * 3600 * 24));
|
|
1066
|
+
if (days <= 7 && !this.alertReported) {
|
|
1067
|
+
this.alertReported = true;
|
|
1068
|
+
await this.registerNotification('iot', 'subscription', validTillDate.toLocaleString());
|
|
1069
|
+
this.log.warn(`Your ioBroker IoT license will expire in ${days} day(s) on ${validTillDate.toDateString()}. Please renew your license to continue using all features without interruption.`);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
await this.setStateAsync('info.validTill', this.validTill, true);
|
|
1073
|
+
}
|
|
1074
|
+
else {
|
|
1075
|
+
this.log.error(`Cannot fetch validTill: ${response.status} ${response.statusText}`);
|
|
1096
1076
|
}
|
|
1097
|
-
this.log.error(`Cannot fetch validTill: ${response.status} ${response.statusText}`);
|
|
1098
1077
|
}
|
|
1099
1078
|
catch (error) {
|
|
1100
1079
|
this.log.error(`Cannot fetch validTill: ${error}`);
|
|
1101
1080
|
}
|
|
1102
|
-
return null;
|
|
1103
1081
|
}
|
|
1104
1082
|
async startDevice(clientId, login, password, retry) {
|
|
1105
1083
|
retry ||= 0;
|
|
@@ -1456,17 +1434,10 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
1456
1434
|
if (this.lang !== 'en' && this.lang !== 'de' && this.lang !== 'ru') {
|
|
1457
1435
|
this.lang = 'en';
|
|
1458
1436
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
this.
|
|
1463
|
-
}
|
|
1464
|
-
else {
|
|
1465
|
-
// Check that update result is empty
|
|
1466
|
-
const state = await this.getStateAsync('smart.updatesResult');
|
|
1467
|
-
if (state?.val) {
|
|
1468
|
-
await this.setStateAsync('smart.updatesResult', '', true);
|
|
1469
|
-
}
|
|
1437
|
+
// Check that update result is empty
|
|
1438
|
+
const state = await this.getStateAsync('smart.updatesResult');
|
|
1439
|
+
if (state?.val) {
|
|
1440
|
+
await this.setStateAsync('smart.updatesResult', '', true);
|
|
1470
1441
|
}
|
|
1471
1442
|
this.remote?.setLanguage(this.lang);
|
|
1472
1443
|
// check password
|
|
@@ -1546,7 +1517,7 @@ class IotAdapter extends adapter_core_1.Adapter {
|
|
|
1546
1517
|
this.yandexAlisa = new alisa_1.default(this, this.urlKey);
|
|
1547
1518
|
}
|
|
1548
1519
|
else {
|
|
1549
|
-
// Check that update result is empty
|
|
1520
|
+
// Check that an update result is empty
|
|
1550
1521
|
const state = await this.getStateAsync('smart.updatesYA');
|
|
1551
1522
|
if (state?.val) {
|
|
1552
1523
|
await this.setStateAsync('smart.updatesYA', '', true);
|