Skip to content

Commit

Permalink
chore: release v8.0.0
Browse files Browse the repository at this point in the history
NodeJS >= 18.x and js-controller >= 5 is required

* (klein0r) Breaking change: Removed support for binary states (deprecated since v6.2.0)
* (klein0r) Breaking change: Protected filesystem (iobroker-data/files) to prevent direct file writes
* (klein0r) Breaking change: request property has been removed of the sandbox (require the module if still needed)
* (klein0r) Added blockly block for global variables (e.g. script name)
* (klein0r) Added missing functions to protectFS
* (klein0r) Fixed httpPost (missing data)
* (klein0r) Fixed hasAttribute blockly block
* (klein0r) Fixed parenthesis insertion in blockly for multi and/or
* (PeterVoronov) Added setStateChanged / setStateChangedAsync
  • Loading branch information
klein0r committed Apr 5, 2024
1 parent 7e0039c commit a96559e
Show file tree
Hide file tree
Showing 18 changed files with 583 additions and 549 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
The newest change log is in README.md
## 7.10.0 (2024-03-21)

* (klein0r) Added warning icon if state value is connected to trigger block (instead of object id)
* (klein0r) Copy date object in getAstroDate
* (klein0r) Added object id as tooltip

## 7.9.4 (2024-03-20)

* (klein0r) Fixed urlencoding for basic auth in url (user:pass)
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the
<!--
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
### 8.0.0 (2024-04-05)

NodeJS >= 18.x and js-controller >= 5 is required

Expand Down Expand Up @@ -81,12 +81,6 @@ NodeJS >= 18.x and js-controller >= 5 is required

* (klein0r) Fixed cron trigger

### 7.10.0 (2024-03-21)

* (klein0r) Added warning icon if state value is connected to trigger block (instead of object id)
* (klein0r) Copy date object in getAstroDate
* (klein0r) Added object id as tooltip

## License
The MIT License (MIT)

Expand Down
10 changes: 5 additions & 5 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"files": {
"main.js": "/static/js/main.12deb862.js",
"main.js": "/static/js/main.ef08b531.js",
"static/css/864.42bfc5f3.chunk.css": "/static/css/864.42bfc5f3.chunk.css",
"static/js/864.2966b63e.chunk.js": "/static/js/864.2966b63e.chunk.js",
"static/js/864.e3ff76b2.chunk.js": "/static/js/864.e3ff76b2.chunk.js",
"static/js/805.7c367e53.chunk.js": "/static/js/805.7c367e53.chunk.js",
"static/js/431.a62490cf.chunk.js": "/static/js/431.a62490cf.chunk.js",
"static/js/702.1692c400.chunk.js": "/static/js/702.1692c400.chunk.js",
Expand Down Expand Up @@ -160,9 +160,9 @@
"static/media/Garage Doors.svg": "/static/media/Garage Doors.0c2a1cfca7ad1ea59625.svg",
"static/media/Outdoor Blinds.svg": "/static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg",
"static/media/Upstairs.svg": "/static/media/Upstairs.441813e54e0daca0882d.svg",
"main.12deb862.js.map": "/static/js/main.12deb862.js.map",
"main.ef08b531.js.map": "/static/js/main.ef08b531.js.map",
"864.42bfc5f3.chunk.css.map": "/static/css/864.42bfc5f3.chunk.css.map",
"864.2966b63e.chunk.js.map": "/static/js/864.2966b63e.chunk.js.map",
"864.e3ff76b2.chunk.js.map": "/static/js/864.e3ff76b2.chunk.js.map",
"805.7c367e53.chunk.js.map": "/static/js/805.7c367e53.chunk.js.map",
"431.a62490cf.chunk.js.map": "/static/js/431.a62490cf.chunk.js.map",
"702.1692c400.chunk.js.map": "/static/js/702.1692c400.chunk.js.map",
Expand Down Expand Up @@ -195,6 +195,6 @@
"96.fe9915d5.chunk.js.map": "/static/js/96.fe9915d5.chunk.js.map"
},
"entrypoints": [
"static/js/main.12deb862.js"
"static/js/main.ef08b531.js"
]
}
4 changes: 2 additions & 2 deletions admin/google-blockly/own/blocks_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Blockly.Blocks['exec_result'] = {
this.setOutput(true);
this.setColour(Blockly.Action.HUE);
this.setTooltip(Blockly.Translate('exec_result_tooltip'));
//this.setHelpUrl(getHelp('exec'));
this.setHelpUrl(getHelp('exec_help'));
},
/**
* Called whenever anything on the workspace changes.
Expand Down Expand Up @@ -371,7 +371,7 @@ Blockly.Blocks['http_response'] = {
this.setOutput(true);
this.setColour(Blockly.Action.HUE);
this.setTooltip(Blockly.Translate('http_response_tooltip'));
//this.setHelpUrl(getHelp('http_response'));
//this.setHelpUrl(getHelp('http_response_help'));
},
/**
* Called whenever anything on the workspace changes.
Expand Down
8 changes: 4 additions & 4 deletions admin/google-blockly/own/blocks_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ Blockly.Blocks['logic_multi_and'] = {
Blockly.JavaScript['logic_multi_and'] = function(block) {
const ands = [];
for (let n = 0; n < block.itemCount_; n++) {
const condition = Blockly.JavaScript.valueToCode(block, 'AND' + n, Blockly.JavaScript.ORDER_COMMA);
const condition = Blockly.JavaScript.valueToCode(block, 'AND' + n, Blockly.JavaScript.ORDER_ATOMIC);
if (condition) {
ands.push(condition);
}
}

return [`(${ands.length > 0 ? ands.join(' && ') : 'false'})`, Blockly.JavaScript.ORDER_LOGICAL_AND];
return [`${ands.length > 0 ? ands.join(' && ') : 'false'}`, Blockly.JavaScript.ORDER_LOGICAL_AND];
};

// --- logic multi or --------------------------------------------------
Expand Down Expand Up @@ -349,13 +349,13 @@ Blockly.Blocks['logic_multi_or'] = {
Blockly.JavaScript['logic_multi_or'] = function(block) {
const ors = [];
for (let n = 0; n < block.itemCount_; n++) {
const condition = Blockly.JavaScript.valueToCode(block, 'OR' + n, Blockly.JavaScript.ORDER_COMMA);
const condition = Blockly.JavaScript.valueToCode(block, 'OR' + n, Blockly.JavaScript.ORDER_ATOMIC);
if (condition) {
ors.push(condition);
}
}

return [`(${ors.length > 0 ? ors.join(' || ') : 'false'})`, Blockly.JavaScript.ORDER_LOGICAL_OR];
return [`${ors.length > 0 ? ors.join(' || ') : 'false'}`, Blockly.JavaScript.ORDER_LOGICAL_OR];
};

// --- logic between --------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions admin/google-blockly/own/blocks_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ Blockly.Blocks['object_has_attr'] = {

Blockly.JavaScript['object_has_attr'] = function(block) {
const obj = Blockly.JavaScript.valueToCode(block, 'OBJECT', Blockly.JavaScript.ORDER_ATOMIC);
const attr = Blockly.JavaScript.valueToCode(block, 'ATTR', Blockly.JavaScript.ORDER_ATOMIC);
const attr = block.getFieldValue('ATTR');

return [`Object.prototype.hasOwnProperty.call(${obj}, ${attr})`, Blockly.JavaScript.ORDER_ATOMIC];
return [`Object.prototype.hasOwnProperty.call(${obj}, '${attr}')`, Blockly.JavaScript.ORDER_ATOMIC];
};

// --- object keys --------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions admin/google-blockly/own/blocks_sendto.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Blockly.Blocks['sendto_otherscript'] = {

this.setColour(Blockly.Sendto.HUE);
this.setTooltip(Blockly.Translate('sendto_otherscript_tooltip'));
this.setHelpUrl(Blockly.Translate('sendto_otherscript_help'));
this.setHelpUrl(getHelp('sendto_otherscript_help'));
}
};

Expand Down Expand Up @@ -570,7 +570,7 @@ Blockly.Blocks['sendto_gethistory'] = {
this.setInputsInline(false);
this.setColour(Blockly.Sendto.HUE);
this.setTooltip(Blockly.Translate('sendto_gethistory_tooltip'));
this.setHelpUrl(Blockly.Translate('sendto_gethistory_help'));
this.setHelpUrl(getHelp('sendto_gethistory_help'));
}
};

Expand Down
33 changes: 33 additions & 0 deletions admin/google-blockly/own/blocks_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@ Blockly.System = {
],
};

// --- global_var -----------------------------------------------------------
Blockly.System.blocks['global_var'] =
'<block type="global_var">'
+ ' <value name="VAR">'
+ ' </value>'
+ '</block>';

Blockly.Blocks['global_var'] = {
/**
* Block for conditionally returning a value from a procedure.
* @this Blockly.Block
*/
init: function() {
this.appendDummyInput('VAR')
.appendField(new Blockly.FieldDropdown([
[Blockly.Translate('global_var_scriptname'), 'scriptName'],
[Blockly.Translate('global_var_defaultdatadir'), 'defaultDataDir'],
[Blockly.Translate('global_var_verbose'), 'verbose'],
]), 'VAR');

this.setInputsInline(true);
this.setOutput(true);
this.setColour(Blockly.System.HUE);
this.setTooltip(Blockly.Translate('global_var_tooltip'));
this.setHelpUrl(getHelp('global_var'));
}
};
Blockly.JavaScript['global_var'] = function(block) {
const variable = block.getFieldValue('VAR');

return [variable, Blockly.JavaScript.ORDER_ATOMIC];
};

// --- Debug output --------------------------------------------------
Blockly.System.blocks['debug'] =
'<block type="debug">'
Expand Down
12 changes: 6 additions & 6 deletions admin/google-blockly/own/blocks_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Blockly.Blocks['time_compare_ex'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_compare_ex_tooltip'));
this.setHelpUrl(Blockly.Translate('time_compare_ex_help'));
this.setHelpUrl(getHelp('time_compare_ex_help'));
},
mutationToDom: function() {
const container = document.createElement('mutation');
Expand Down Expand Up @@ -220,7 +220,7 @@ Blockly.Blocks['time_compare'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_compare_tooltip'));
this.setHelpUrl(Blockly.Translate('time_compare_help'));
this.setHelpUrl(getHelp('time_compare_help'));
},

mutationToDom: function() {
Expand Down Expand Up @@ -343,7 +343,7 @@ Blockly.Blocks['time_get'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_get_tooltip'));
this.setHelpUrl(Blockly.Translate('time_get_help'));
//this.setHelpUrl(getHelp('time_get_help'));
},
mutationToDom: function() {
const container = document.createElement('mutation');
Expand Down Expand Up @@ -473,7 +473,7 @@ Blockly.Blocks['time_get_special'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_get_special_tooltip'));
this.setHelpUrl(Blockly.Translate('time_get_special_help'));
//this.setHelpUrl(getHelp('time_get_special_help'));
},
};

Expand Down Expand Up @@ -540,7 +540,7 @@ Blockly.Blocks['time_astro'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_astro_tooltip'));
this.setHelpUrl(Blockly.Translate('time_astro_help'));
this.setHelpUrl(getHelp('time_astro_help'));
}
};

Expand Down Expand Up @@ -603,7 +603,7 @@ Blockly.Blocks['time_calculation'] = {

this.setColour(Blockly.Time.HUE);
this.setTooltip(Blockly.Translate('time_calculation_tooltip'));
this.setHelpUrl(Blockly.Translate('time_calculation_help'));
//this.setHelpUrl(getHelp('time_calculation_help'));
},
};

Expand Down

0 comments on commit a96559e

Please sign in to comment.