iobroker.javascript 5.3.2 → 5.3.3
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 +3 -3
- package/admin/asset-manifest.json +3 -3
- package/admin/static/js/{main.9c6dd193.chunk.js → main.55d1a215.chunk.js} +2 -2
- package/admin/static/js/{main.9c6dd193.chunk.js.map → main.55d1a215.chunk.js.map} +1 -1
- package/admin/tab.html +1 -1
- package/docs/en/javascript.md +17 -1
- package/io-package.json +13 -13
- package/lib/sandbox.js +15 -5
- package/package.json +4 -4
package/admin/tab.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="shortcut icon" href="favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="manifest.json"><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./../../lib/js/socket.io.js"></script><title>Scripts</title><script type="text/javascript" src="google-blockly/blockly_compressed.js"></script><script type="text/javascript" src="google-blockly/msg/js/en.js"></script><script type="text/javascript" src="google-blockly/blocks_compressed.js"></script><script type="text/javascript" src="google-blockly/javascript_compressed.js"></script><script type="text/javascript" src="google-blockly/own/blocks_words.js"></script><script type="text/javascript" src="google-blockly/own/field_oid.js"></script><script type="text/javascript" src="google-blockly/own/field_cron.js"></script><script type="text/javascript" src="google-blockly/own/field_script.js"></script><script type="text/javascript" src="google-blockly/own/blocks_system.js"></script><script type="text/javascript" src="google-blockly/own/blocks_action.js"></script><script type="text/javascript" src="google-blockly/own/blocks_sendto.js"></script><script type="text/javascript" src="google-blockly/own/blocks_time.js"></script><script type="text/javascript" src="google-blockly/own/blocks_convert.js"></script><script type="text/javascript" src="google-blockly/own/blocks_trigger.js"></script><script type="text/javascript" src="google-blockly/own/blocks_procedures.js"></script><script type="text/javascript" src="google-blockly/own/blocks_timeout.js"></script><script type="text/javascript" src="google-blockly/own/blocks_switch.js"></script><style>.iobVerticalSplitter .layout-pane-primary{overflow:hidden!important}</style><link href="static/css/2.a442f2b4.chunk.css" rel="stylesheet"><link href="static/css/main.5b5813ce.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><script>"dark"===(window.localStorage&&window.localStorage.getItem("App.theme"))&&(window.document.body.style.background="black")</script><div id="root"></div><xml id="toolbox" style="display:none"><category><block>%%CUSTOM_BLOCKS%%</block></category><sep></sep><category name="{catLogic}" colour="210"><block type="controls_if"></block><block type="logic_compare"></block><block type="logic_operation"></block><block type="logic_negate"></block><block type="logic_boolean"></block><block type="logic_null"></block><block type="logic_ternary"></block><block type="logic_switch_case"></block></category><category name="{catLoops}" colour="120"><block type="controls_repeat_ext"><value name="TIMES"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="controls_whileUntil"></block><block type="controls_for"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">10</field></shadow></value><value name="BY"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="controls_forEach"></block><block type="controls_flow_statements"></block></category><category name="{catMath}" colour="230"><block type="math_number"></block><block type="math_arithmetic"><value name="A"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_single"><value name="NUM"><shadow type="math_number"><field name="NUM">9</field></shadow></value></block><block type="math_trig"><value name="NUM"><shadow type="math_number"><field name="NUM">45</field></shadow></value></block><block type="math_constant"></block><block type="math_number_property"><value name="NUMBER_TO_CHECK"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="math_change"><value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_round"><value name="NUM"><shadow type="math_number"><field name="NUM">3.1</field></shadow></value></block><block type="math_rndfixed"><value name="x"><shadow type="math_number"><field name="NUM">3.1234</field></shadow></value><value name="n"><shadow type="math_number"><field name="NUM">2</field></shadow></value></block><block type="math_on_list"></block><block type="math_modulo"><value name="DIVIDEND"><shadow type="math_number"><field name="NUM">64</field></shadow></value><value name="DIVISOR"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="math_constrain"><value name="VALUE"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="LOW"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="HIGH"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_int"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_float"></block></category><category name="{catText}" colour="160"><block type="text"></block><block type="text_newline"></block><block type="text_multiline"></block><block type="text_join"></block><block type="text_append"><value name="TEXT"><shadow type="text"></shadow></value></block><block type="text_length"><value name="VALUE"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_isEmpty"><value name="VALUE"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="text_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value><value name="FIND"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_charAt"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_getSubstring"><value name="STRING"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_changeCase"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_trim"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block></category><category name="{catLists}" colour="260"><block type="lists_create_with"><mutation items="0"></mutation></block><block type="lists_create_with"></block><block type="lists_repeat"><value name="NUM"><shadow type="math_number"><field name="NUM">5</field></shadow></value></block><block type="lists_length"></block><block type="lists_isEmpty"></block><block type="lists_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getIndex"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_setIndex"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getSublist"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_split"><value name="DELIM"><shadow type="text"><field name="TEXT">,</field></shadow></value></block><block type="lists_sort"></block></category><category name="{catColour}" colour="20"><block type="colour_picker"></block><block type="colour_random"></block><block type="colour_rgb"><value name="RED"><shadow type="math_number"><field name="NUM">100</field></shadow></value><value name="GREEN"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="BLUE"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="colour_blend"><value name="COLOUR1"><shadow type="colour_picker"><field name="COLOUR">#ff0000</field></shadow></value><value name="COLOUR2"><shadow type="colour_picker"><field name="COLOUR">#3333ff</field></shadow></value><value name="RATIO"><shadow type="math_number"><field name="NUM">0.5</field></shadow></value></block></category><sep></sep><category name="{catVariables}" colour="330" custom="VARIABLE"></category><category name="{catFunctions}" colour="290" custom="PROCEDURE"></category></xml><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonpjs=this.webpackJsonpjs||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="static/js/2.b35d4219.chunk.js"></script><script src="static/js/main.9c6dd193.chunk.js"></script><script type="text/javascript" src="vs/loader.js"></script><script type="text/javascript" src="vs/configure.js"></script></body></html>
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="shortcut icon" href="favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="manifest.json"><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./../../lib/js/socket.io.js"></script><title>Scripts</title><script type="text/javascript" src="google-blockly/blockly_compressed.js"></script><script type="text/javascript" src="google-blockly/msg/js/en.js"></script><script type="text/javascript" src="google-blockly/blocks_compressed.js"></script><script type="text/javascript" src="google-blockly/javascript_compressed.js"></script><script type="text/javascript" src="google-blockly/own/blocks_words.js"></script><script type="text/javascript" src="google-blockly/own/field_oid.js"></script><script type="text/javascript" src="google-blockly/own/field_cron.js"></script><script type="text/javascript" src="google-blockly/own/field_script.js"></script><script type="text/javascript" src="google-blockly/own/blocks_system.js"></script><script type="text/javascript" src="google-blockly/own/blocks_action.js"></script><script type="text/javascript" src="google-blockly/own/blocks_sendto.js"></script><script type="text/javascript" src="google-blockly/own/blocks_time.js"></script><script type="text/javascript" src="google-blockly/own/blocks_convert.js"></script><script type="text/javascript" src="google-blockly/own/blocks_trigger.js"></script><script type="text/javascript" src="google-blockly/own/blocks_procedures.js"></script><script type="text/javascript" src="google-blockly/own/blocks_timeout.js"></script><script type="text/javascript" src="google-blockly/own/blocks_switch.js"></script><style>.iobVerticalSplitter .layout-pane-primary{overflow:hidden!important}</style><link href="static/css/2.a442f2b4.chunk.css" rel="stylesheet"><link href="static/css/main.5b5813ce.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><script>"dark"===(window.localStorage&&window.localStorage.getItem("App.theme"))&&(window.document.body.style.background="black")</script><div id="root"></div><xml id="toolbox" style="display:none"><category><block>%%CUSTOM_BLOCKS%%</block></category><sep></sep><category name="{catLogic}" colour="210"><block type="controls_if"></block><block type="logic_compare"></block><block type="logic_operation"></block><block type="logic_negate"></block><block type="logic_boolean"></block><block type="logic_null"></block><block type="logic_ternary"></block><block type="logic_switch_case"></block></category><category name="{catLoops}" colour="120"><block type="controls_repeat_ext"><value name="TIMES"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="controls_whileUntil"></block><block type="controls_for"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">10</field></shadow></value><value name="BY"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="controls_forEach"></block><block type="controls_flow_statements"></block></category><category name="{catMath}" colour="230"><block type="math_number"></block><block type="math_arithmetic"><value name="A"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_single"><value name="NUM"><shadow type="math_number"><field name="NUM">9</field></shadow></value></block><block type="math_trig"><value name="NUM"><shadow type="math_number"><field name="NUM">45</field></shadow></value></block><block type="math_constant"></block><block type="math_number_property"><value name="NUMBER_TO_CHECK"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="math_change"><value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_round"><value name="NUM"><shadow type="math_number"><field name="NUM">3.1</field></shadow></value></block><block type="math_rndfixed"><value name="x"><shadow type="math_number"><field name="NUM">3.1234</field></shadow></value><value name="n"><shadow type="math_number"><field name="NUM">2</field></shadow></value></block><block type="math_on_list"></block><block type="math_modulo"><value name="DIVIDEND"><shadow type="math_number"><field name="NUM">64</field></shadow></value><value name="DIVISOR"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="math_constrain"><value name="VALUE"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="LOW"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="HIGH"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_int"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_float"></block></category><category name="{catText}" colour="160"><block type="text"></block><block type="text_newline"></block><block type="text_multiline"></block><block type="text_join"></block><block type="text_append"><value name="TEXT"><shadow type="text"></shadow></value></block><block type="text_length"><value name="VALUE"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_isEmpty"><value name="VALUE"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="text_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value><value name="FIND"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_charAt"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_getSubstring"><value name="STRING"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_changeCase"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_trim"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block></category><category name="{catLists}" colour="260"><block type="lists_create_with"><mutation items="0"></mutation></block><block type="lists_create_with"></block><block type="lists_repeat"><value name="NUM"><shadow type="math_number"><field name="NUM">5</field></shadow></value></block><block type="lists_length"></block><block type="lists_isEmpty"></block><block type="lists_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getIndex"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_setIndex"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getSublist"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_split"><value name="DELIM"><shadow type="text"><field name="TEXT">,</field></shadow></value></block><block type="lists_sort"></block></category><category name="{catColour}" colour="20"><block type="colour_picker"></block><block type="colour_random"></block><block type="colour_rgb"><value name="RED"><shadow type="math_number"><field name="NUM">100</field></shadow></value><value name="GREEN"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="BLUE"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="colour_blend"><value name="COLOUR1"><shadow type="colour_picker"><field name="COLOUR">#ff0000</field></shadow></value><value name="COLOUR2"><shadow type="colour_picker"><field name="COLOUR">#3333ff</field></shadow></value><value name="RATIO"><shadow type="math_number"><field name="NUM">0.5</field></shadow></value></block></category><sep></sep><category name="{catVariables}" colour="330" custom="VARIABLE"></category><category name="{catFunctions}" colour="290" custom="PROCEDURE"></category></xml><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonpjs=this.webpackJsonpjs||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="static/js/2.b35d4219.chunk.js"></script><script src="static/js/main.55d1a215.chunk.js"></script><script type="text/javascript" src="vs/loader.js"></script><script type="text/javascript" src="vs/configure.js"></script></body></html>
|
package/docs/en/javascript.md
CHANGED
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
- [getIdByName](#getidbyname)
|
|
37
37
|
- [getEnums](#getenums)
|
|
38
38
|
- [createState](#createstate)
|
|
39
|
+
- [createStateAsync](#createstateasync)
|
|
39
40
|
- [deleteState](#deletestate)
|
|
41
|
+
- [deleteStateAsync](#deletestateasync)
|
|
40
42
|
- [sendTo](#sendto)
|
|
41
43
|
- [sendToHost](#sendtohost)
|
|
42
44
|
- [setInterval](#setinterval)
|
|
@@ -945,7 +947,7 @@ getEnums('rooms');
|
|
|
945
947
|
```js
|
|
946
948
|
createState(name, initialValue, forceCreation, common, native, callback);
|
|
947
949
|
```
|
|
948
|
-
Create state and object in javascript space if does not exist, e.g. "javascript.0.mystate".
|
|
950
|
+
Create state and object in javascript space if it does not exist, e.g. "javascript.0.mystate".
|
|
949
951
|
|
|
950
952
|
#### Parameters:
|
|
951
953
|
|
|
@@ -963,6 +965,13 @@ It is possible short type of createState:
|
|
|
963
965
|
- `createState('myVariable', {name: 'My own variable', unit: '°C'}, function () {log('created');});`
|
|
964
966
|
- `createState('myVariable', 1, {name: 'My own variable', unit: '°C'})` - create variable if does not exist with specific name and units
|
|
965
967
|
|
|
968
|
+
### createStateAsync
|
|
969
|
+
```js
|
|
970
|
+
await createStateAsync(name, initialValue, forceCreation, common, native);
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
Same as `createState`, but the promise will be returned.
|
|
974
|
+
|
|
966
975
|
### deleteState
|
|
967
976
|
```js
|
|
968
977
|
deleteState(name, callback);
|
|
@@ -974,6 +983,13 @@ deleteState('myVariable')
|
|
|
974
983
|
```
|
|
975
984
|
simply delete variable if exists.
|
|
976
985
|
|
|
986
|
+
### deleteStateAsync
|
|
987
|
+
```js
|
|
988
|
+
await deleteStateAsync(name);
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
Same as `deleteState`, but the promise will be returned.
|
|
992
|
+
|
|
977
993
|
### sendTo
|
|
978
994
|
```js
|
|
979
995
|
sendTo(adapter, command, message, callback);
|
package/io-package.json
CHANGED
|
@@ -20,8 +20,20 @@
|
|
|
20
20
|
"Apollon77 <iobroker@fischer-ka.de>",
|
|
21
21
|
"AlCalzone"
|
|
22
22
|
],
|
|
23
|
-
"version": "5.3.
|
|
23
|
+
"version": "5.3.3",
|
|
24
24
|
"news": {
|
|
25
|
+
"5.3.3": {
|
|
26
|
+
"en": "Added async functions: createStateAsync, deleteStateAsync",
|
|
27
|
+
"de": "Asynchrone Funktionen hinzugefügt: createStateAsync, deleteStateAsync",
|
|
28
|
+
"ru": "Добавлены асинхронные функции: createStateAsync, deleteStateAsync.",
|
|
29
|
+
"pt": "Funções assíncronas adicionadas: createStateAsync, deleteStateAsync",
|
|
30
|
+
"nl": "Toegevoegde asynchrone functies: createStateAsync, deleteStateAsync",
|
|
31
|
+
"fr": "Fonctions asynchrones ajoutées : createStateAsync, deleteStateAsync",
|
|
32
|
+
"it": "Aggiunte funzioni asincrone: createStateAsync, deleteStateAsync",
|
|
33
|
+
"es": "Funciones asincrónicas agregadas: createStateAsync, deleteStateAsync",
|
|
34
|
+
"pl": "Dodano funkcje asynchroniczne: createStateAsync, deleteStateAsync",
|
|
35
|
+
"zh-cn": "添加了异步函数:createStateAsync、deleteStateAsync"
|
|
36
|
+
},
|
|
25
37
|
"5.3.2": {
|
|
26
38
|
"en": "fix problem that scripts were not starting when scriptsEnabled State was triggered (or startScript was used)\nMake sure callbacks on startScript/stopScript work and Async variants also resolve\nMake sure startScriptAsync, stopScriptAsync and runScriptAsync resolve in debug mode too",
|
|
27
39
|
"de": "Behebung des Problems, dass Skripte nicht gestartet wurden, wenn scriptsEnabled State ausgelöst wurde (oder startScript verwendet wurde)\nStellen Sie sicher, dass Callbacks auf startScript/stopScript funktionieren und Async-Varianten ebenfalls aufgelöst werden\nStellen Sie sicher, dass startScriptAsync, stopScriptAsync und runScriptAsync auch im Debugmodus aufgelöst werden",
|
|
@@ -93,18 +105,6 @@
|
|
|
93
105
|
"es": "Arreglar la dependencia rota",
|
|
94
106
|
"pl": "Napraw zepsutą zależność",
|
|
95
107
|
"zh-cn": "修复损坏的依赖"
|
|
96
|
-
},
|
|
97
|
-
"5.2.18": {
|
|
98
|
-
"en": "Fixed some german translations\nFixed astro schedules",
|
|
99
|
-
"de": "Einige deutsche Übersetzungen korrigiert\nFeste Astrozeitpläne",
|
|
100
|
-
"ru": "Исправлены некоторые немецкие переводы\nФиксированные астро-графики",
|
|
101
|
-
"pt": "Corrigidas algumas traduções para o alemão\nProgramações de astro corrigidas",
|
|
102
|
-
"nl": "Enkele Duitse vertalingen gerepareerd\nVaste astro-schema's",
|
|
103
|
-
"fr": "Correction de certaines traductions allemandes\nHoraires astro fixes",
|
|
104
|
-
"it": "Risolte alcune traduzioni in tedesco\nOrari astronomici fissi",
|
|
105
|
-
"es": "Se corrigieron algunas traducciones alemanas.\nHorarios astro fijos",
|
|
106
|
-
"pl": "Naprawiono niektóre niemieckie tłumaczenia\nStałe harmonogramy astro",
|
|
107
|
-
"zh-cn": "修正了一些德语翻译\n固定的天文时间表"
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"desc": {
|
package/lib/sandbox.js
CHANGED
|
@@ -1884,6 +1884,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
1884
1884
|
}
|
|
1885
1885
|
return;
|
|
1886
1886
|
}
|
|
1887
|
+
|
|
1887
1888
|
if (!name) {
|
|
1888
1889
|
const err = 'Empty ID is not allowed.';
|
|
1889
1890
|
sandbox.log(err, 'error');
|
|
@@ -1896,6 +1897,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
1896
1897
|
}
|
|
1897
1898
|
return;
|
|
1898
1899
|
}
|
|
1900
|
+
|
|
1899
1901
|
common = common || {};
|
|
1900
1902
|
common.name = common.name || name;
|
|
1901
1903
|
common.role = common.role || 'state';
|
|
@@ -1917,7 +1919,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
1917
1919
|
if (typeof min !== 'number') {
|
|
1918
1920
|
min = parseFloat(min);
|
|
1919
1921
|
if (isNaN(min)) {
|
|
1920
|
-
err =
|
|
1922
|
+
err = `Wrong type of ${name}.common.min`;
|
|
1921
1923
|
sandbox.log(err, 'error');
|
|
1922
1924
|
if (typeof callback === 'function') {
|
|
1923
1925
|
try {
|
|
@@ -1937,7 +1939,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
1937
1939
|
if (typeof max !== 'number') {
|
|
1938
1940
|
max = parseFloat(max);
|
|
1939
1941
|
if (isNaN(max)) {
|
|
1940
|
-
err =
|
|
1942
|
+
err = `Wrong type of ${name}.common.max`;
|
|
1941
1943
|
sandbox.log(err, 'error');
|
|
1942
1944
|
if (typeof callback === 'function') {
|
|
1943
1945
|
try {
|
|
@@ -1957,7 +1959,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
1957
1959
|
if (typeof def !== 'number') {
|
|
1958
1960
|
def = parseFloat(def);
|
|
1959
1961
|
if (isNaN(def)) {
|
|
1960
|
-
err =
|
|
1962
|
+
err = `Wrong type of ${name}.common.def`;
|
|
1961
1963
|
sandbox.log(err, 'error');
|
|
1962
1964
|
if (typeof callback === 'function') {
|
|
1963
1965
|
try {
|
|
@@ -2044,6 +2046,10 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
2044
2046
|
}
|
|
2045
2047
|
});
|
|
2046
2048
|
},
|
|
2049
|
+
createStateAsync: function (name, initValue, forceCreation, common, native) {
|
|
2050
|
+
return new Promise((resolve, reject) =>
|
|
2051
|
+
sandbox.createState(name, initValue, forceCreation, common, native, (err, id) => err ? reject(err) : resolve(id)));
|
|
2052
|
+
},
|
|
2047
2053
|
deleteState: function (id, callback) {
|
|
2048
2054
|
// todo: check rights
|
|
2049
2055
|
// todo: also remove from "names"
|
|
@@ -2102,11 +2108,15 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
2102
2108
|
try {
|
|
2103
2109
|
callback.call(sandbox, err, found);
|
|
2104
2110
|
} catch (e) {
|
|
2105
|
-
errorInCallback(e); //adapter.log.error('Error in callback: ' + e)
|
|
2111
|
+
errorInCallback(e); // adapter.log.error('Error in callback: ' + e)
|
|
2106
2112
|
}
|
|
2107
2113
|
}
|
|
2108
2114
|
}
|
|
2109
2115
|
},
|
|
2116
|
+
deleteStateAsync: function (id) {
|
|
2117
|
+
return new Promise((resolve, reject) =>
|
|
2118
|
+
sandbox.deleteState(id, (err, found) => err ? reject(err) : resolve(found)));
|
|
2119
|
+
},
|
|
2110
2120
|
sendTo: function (_adapter, cmd, msg, callback) {
|
|
2111
2121
|
sandbox.verbose && sandbox.log(`sendTo(adapter=${_adapter}, cmd=${cmd}, msg=${JSON.stringify(msg)})`, 'info');
|
|
2112
2122
|
adapter.sendTo(_adapter, cmd, msg, callback);
|
|
@@ -2798,7 +2808,7 @@ function sandBox(script, name, verbose, debug, context) {
|
|
|
2798
2808
|
obj = JSON.parse(obj);
|
|
2799
2809
|
} catch (e) {
|
|
2800
2810
|
adapter.setState('scriptProblem.' + name.substring('script.js.'.length), true, true);
|
|
2801
|
-
sandbox.log(
|
|
2811
|
+
sandbox.log(`Cannot parse "${obj.substring(0, 30)}"${e}`, 'error');
|
|
2802
2812
|
return null;
|
|
2803
2813
|
}
|
|
2804
2814
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.javascript",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"description": "Rules Engine for ioBroker",
|
|
5
5
|
"author": "bluefox <dogafox@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"wake_on_lan": "^1.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@alcalzone/release-script": "^3.5.
|
|
49
|
-
"@alcalzone/release-script-plugin-iobroker": "^3.5.
|
|
50
|
-
"@alcalzone/release-script-plugin-license": "^3.5.
|
|
48
|
+
"@alcalzone/release-script": "^3.5.6",
|
|
49
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.5.6",
|
|
50
|
+
"@alcalzone/release-script-plugin-license": "^3.5.3",
|
|
51
51
|
"@types/iobroker": "^4.0.1",
|
|
52
52
|
"alcalzone-shared": "^4.0.1",
|
|
53
53
|
"chai": "^4.3.6",
|