iobroker.iot 3.5.2 → 3.6.0
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/README.md +16 -5
- package/admin/assets/{index-Df2NS929.js → index-DCbOB3g_.js} +79 -79
- package/admin/index_m.html +1 -1
- package/admin/rules/assets/{index-BwcOGyWI.js → index-BRdNnGcA.js} +66 -66
- package/admin/rules/customRuleBlocks.js +2 -2
- package/io-package.json +14 -14
- package/lib/visuApp.js +13 -3
- package/main.js +14 -4
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-
|
|
2
|
-
import{i as m,A as p}from"./assets/ActionVisu__mf_v__runtimeInit__mf_v__-Cz053nO7.js";import s from"./assets/virtualExposes-BqVak7rX.js";import{_ as n}from"./assets/preload-helper-Dp1pzeXC.js";const i={"@iobroker/adapter-react-v5":async()=>await n(()=>import("./assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-BRdNnGcA.js","./assets/ActionVisu__loadShare__react__loadShare__-Cg21Ef1U.js","./assets/_commonjsHelpers-Cpj98o6Y.js","./assets/ActionVisu__mf_v__runtimeInit__mf_v__-Cz053nO7.js","./assets/ActionVisu__loadShare__react_mf_2_dom__loadShare__-B1zRWn0u.js","./assets/index-Do-nCdWy.js","./assets/index-CAAeiKCc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as m,A as p}from"./assets/ActionVisu__mf_v__runtimeInit__mf_v__-Cz053nO7.js";import s from"./assets/virtualExposes-BqVak7rX.js";import{_ as n}from"./assets/preload-helper-Dp1pzeXC.js";const i={"@iobroker/adapter-react-v5":async()=>await n(()=>import("./assets/index-BRdNnGcA.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),react:async()=>await n(()=>import("./assets/index-Do-nCdWy.js").then(t=>t.i),__vite__mapDeps([5,2]),import.meta.url),"react-dom":async()=>await n(()=>import("./assets/index-CAAeiKCc.js").then(t=>t.i),__vite__mapDeps([6,2,1,3]),import.meta.url)},a={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"7.7.1",scope:["default"],loaded:!1,from:"ActionVisu",async get(){a["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"ActionVisu",async get(){a.react.loaded=!0;const{react:e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"ActionVisu",async get(){a["react-dom"].loaded=!0;const{"react-dom":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},f=[],u={},c="default",d="ActionVisu";async function k(e={},t=[]){const r=m.init({name:d,remotes:f,shared:a,plugins:[],shareStrategy:"version-first"});var o=u[c];if(o||(o=u[c]={from:d}),!(t.indexOf(o)>=0)){t.push(o),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(l){console.error(l)}return p.initResolve(r),r}}function y(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(t=>()=>t)}export{y as get,k as init};
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "iot",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.6.0": {
|
|
7
|
+
"en": "new features for upcoming Visu App 1.4.0",
|
|
8
|
+
"de": "neue Features für die kommende Visu App 1.4.0",
|
|
9
|
+
"ru": "новые возможности для Visu App 1.4.0",
|
|
10
|
+
"pt": "novas funcionalidades para a próxima aplicação Visu 1.4.0",
|
|
11
|
+
"nl": "nieuwe functies voor Visu App 1.4.0",
|
|
12
|
+
"fr": "nouvelles fonctionnalités pour Visu App à venir 1.4.0",
|
|
13
|
+
"it": "nuove funzionalità per il prossimo Visu App 1.4.0",
|
|
14
|
+
"es": "nuevas características para la próxima aplicación Visu 1.4.0",
|
|
15
|
+
"pl": "nowe funkcje dla nadchodzącej aplikacji Visu 1.4.0",
|
|
16
|
+
"uk": "нові можливості для майбутнього додатка Visu 1.4.0",
|
|
17
|
+
"zh-cn": "即将到来的 Visu App 1.4.0 的新功能"
|
|
18
|
+
},
|
|
6
19
|
"3.5.2": {
|
|
7
20
|
"en": "Corrected error in back-end",
|
|
8
21
|
"de": "Fehler im Back-End behoben",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "poprawiła dodanie urządzeń dla Alexa\nzmiana kompilacji GUI w celu usunięcia zdeprecjonowanych pakietów",
|
|
81
94
|
"uk": "виправлено додавання пристроїв для Alexa\nзмінена компіляція GUI для видалення депресованих пакетів",
|
|
82
95
|
"zh-cn": "修正了为Alexa添加的设备\n更改 GUI 的编译以删除已贬值的软件包"
|
|
83
|
-
},
|
|
84
|
-
"3.4.2": {
|
|
85
|
-
"en": "Updated GUI packages and removed `gulp`\ndo not override custom `result` attribute on `sendToAdapter` response (Visu App - only relevant for developers)",
|
|
86
|
-
"de": "Aktualisierte GUI-Pakete und entfernt `gulp`\nnicht überschreiben benutzerdefinierte `result` Attribut auf `sendToAdapter` Antwort (Visu App - nur für Entwickler relevant)",
|
|
87
|
-
"ru": "Обновленные пакеты GUI и удаленные `gulp'\nне переопределять пользовательский атрибут `result' на ответе `sendToAdapter' (Visu App - только соответствующий для разработчиков)",
|
|
88
|
-
"pt": "Pacotes de GUI atualizados e removidos `gulp`\nnão substituir o atributo `result` personalizado na resposta `sendToAdapter` (Visu App - apenas relevante para desenvolvedores)",
|
|
89
|
-
"nl": "Bijgewerkt GUI-pakketten en verwijderde GUI-pakketten\ngeen attribuut overschrijven op aangepaste ",
|
|
90
|
-
"fr": "Mise à jour des paquets GUI et suppression de 'gulp'\nne pas surcharger l'attribut `result` personnalisé sur la réponse `sendToAdapter` (Visu App - uniquement pertinent pour les développeurs)",
|
|
91
|
-
"it": "Pacchetti GUI aggiornati e rimossi `gulp`\nnon sovrascrivere l'attributo `risultato` personalizzato sulla risposta `sendToAdapter` (Visu App - solo pertinente per gli sviluppatori)",
|
|
92
|
-
"es": "Paquetes GUI actualizados y eliminados\nno invalidar el atributo personalizado `result` en la respuesta `sendToAdapter` (Visu App - sólo relevante para desarrolladores)",
|
|
93
|
-
"pl": "Aktualizacja pakietów GUI i usunięcie 'gulp'\nnie nadpisywać atrybutu 'result' w odpowiedzi 'sendToAdapter' (aplikacja Visu - dotyczy tylko deweloperów)",
|
|
94
|
-
"uk": "Оновлено пакети GUI та видалено `gulp`\nне перевизначте користувацький атрибут `result` на відповідь `sendToAdapter` (Visu App - тільки відповідний розробникам)",
|
|
95
|
-
"zh-cn": "更新了 GUI 软件包并删除了“ gulp ”\n不在“ sendToAdapter” 响应上覆盖自定义的“ 结果”属性( Visu App - 仅与开发者相关)"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/visuApp.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Handles `sendToAdapter` command
|
|
5
|
+
*
|
|
5
6
|
* @param {SendToAdapterCommand} visuData the data sent by the app
|
|
6
7
|
* @param {ioBroker.Adapter} adapter the adapter instance
|
|
7
8
|
* @returns {Promise<Record<string, any>>}
|
|
@@ -17,6 +18,7 @@ async function handleSendToAdapter(visuData, adapter) {
|
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Handles `sendToAdapter` command
|
|
21
|
+
*
|
|
20
22
|
* @param {GetInstancesCommand} visuData the data sent by the app
|
|
21
23
|
* @param {ioBroker.Adapter} adapter the adapter instance
|
|
22
24
|
* @returns {Promise<{ instances: string[] }>}
|
|
@@ -65,7 +67,7 @@ async function handleGeofenceData(visuData, adapter) {
|
|
|
65
67
|
native: {},
|
|
66
68
|
});
|
|
67
69
|
|
|
68
|
-
await adapter.
|
|
70
|
+
await adapter.setState(id, presenceStatus, true);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -82,8 +84,8 @@ async function handleDevicesData(visuData, adapter) {
|
|
|
82
84
|
await adapter.setObjectNotExistsAsync(deviceId, {
|
|
83
85
|
type: 'folder',
|
|
84
86
|
common: {
|
|
85
|
-
name:
|
|
86
|
-
desc: '
|
|
87
|
+
name: deviceName,
|
|
88
|
+
desc: 'All states related to this device',
|
|
87
89
|
},
|
|
88
90
|
native: {},
|
|
89
91
|
});
|
|
@@ -108,6 +110,14 @@ async function handleDevicesData(visuData, adapter) {
|
|
|
108
110
|
|
|
109
111
|
/** Map data name to state common */
|
|
110
112
|
const commonMapping = {
|
|
113
|
+
actionResponse: {
|
|
114
|
+
name: 'Action response for a notification',
|
|
115
|
+
desc: 'User clicked on a notification and this is the response from the app',
|
|
116
|
+
type: 'string',
|
|
117
|
+
read: true,
|
|
118
|
+
write: false,
|
|
119
|
+
role: 'text',
|
|
120
|
+
},
|
|
111
121
|
ssid: {
|
|
112
122
|
name: 'Current connected WiFi',
|
|
113
123
|
desc: 'Current connected WiFi network',
|
package/main.js
CHANGED
|
@@ -77,9 +77,13 @@ function startAdapter(options) {
|
|
|
77
77
|
|
|
78
78
|
id && remote && remote.updateObject(id, obj);
|
|
79
79
|
},
|
|
80
|
-
stateChange: (id, state) => {
|
|
80
|
+
stateChange: async (id, state) => {
|
|
81
81
|
if (id === `${adapter.namespace}.app.message` && state && !state.ack) {
|
|
82
|
-
|
|
82
|
+
try {
|
|
83
|
+
await sendMessageToApp(state.val);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
adapter.log.error(`Cannot send message to app: ${e}`);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
state && adapter.config.googleHome && googleHome && googleHome.updateState(id, state);
|
|
@@ -401,6 +405,12 @@ function sendDataToIFTTT(obj) {
|
|
|
401
405
|
}
|
|
402
406
|
}
|
|
403
407
|
|
|
408
|
+
/**
|
|
409
|
+
* Send a message to the ioBroker Visu App by using the app-message endpoint (which then forwards it to the app via FCM)
|
|
410
|
+
*
|
|
411
|
+
* @param message either a json string or the message itself, if the message itself the other props will be taken from the adapter states
|
|
412
|
+
* @returns {Promise<void>}
|
|
413
|
+
*/
|
|
404
414
|
async function sendMessageToApp(message) {
|
|
405
415
|
if (!message) {
|
|
406
416
|
throw new Error('Empty message');
|
|
@@ -409,7 +419,7 @@ async function sendMessageToApp(message) {
|
|
|
409
419
|
if (json.startsWith('{') && json.endsWith('}')) {
|
|
410
420
|
try {
|
|
411
421
|
json = JSON.parse(json);
|
|
412
|
-
} catch
|
|
422
|
+
} catch {
|
|
413
423
|
adapter.log.warn(`Cannot parse message: ${json}`);
|
|
414
424
|
json = null;
|
|
415
425
|
}
|
|
@@ -456,7 +466,7 @@ async function sendMessageToApp(message) {
|
|
|
456
466
|
'Content-Type': 'application/json',
|
|
457
467
|
Authorization: `Bearer ${Buffer.from(`${adapter.config.login}:${adapter.config.pass}`).toString('base64')}`,
|
|
458
468
|
},
|
|
459
|
-
timeout:
|
|
469
|
+
timeout: 5_000,
|
|
460
470
|
validateStatus: status => status < 400,
|
|
461
471
|
});
|
|
462
472
|
await adapter.setState('app.message', message, true);
|