Skip to content

Commit

Permalink
chore: release v5.0.9
Browse files Browse the repository at this point in the history
fixed the error if no condition
  • Loading branch information
GermanBluefox committed Mar 4, 2021
1 parent 28217c8 commit b06838b
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
The newest change log is in README.md

## 5.0.4 (2021-02-28)
* (bluefox) Fixed errors in rules

## 5.0.3 (2021-02-28)
* (bluefox) Implemented the memory for condition

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ And then call `npm run build`.
-->

## Changelog
### 5.0.9 (2021-03-04)
* (bluefox) fixed the error if no condition

### 5.0.8 (2021-03-03)
* (bluefox) Translations
* (bluefox) Added the "set state with delay" block
Expand All @@ -50,9 +53,6 @@ And then call `npm run build`.
### 5.0.5 (2021-02-28)
* (bluefox) Implemented the toggle functionality

### 5.0.4 (2021-02-28)
* (bluefox) Fixed errors in rules

## License

The MIT License (MIT)
Expand Down
8 changes: 4 additions & 4 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"files": {
"main.css": "/static/css/main.8c2979b3.chunk.css",
"main.js": "/static/js/main.c0af4e5f.chunk.js",
"main.js.map": "/static/js/main.c0af4e5f.chunk.js.map",
"main.js": "/static/js/main.3b6cefda.chunk.js",
"main.js.map": "/static/js/main.3b6cefda.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.4f1bbf1b.js",
"runtime-main.js.map": "/static/js/runtime-main.4f1bbf1b.js.map",
"static/css/2.2ae070eb.chunk.css": "/static/css/2.2ae070eb.chunk.css",
Expand All @@ -12,14 +12,14 @@
"static/css/2.2ae070eb.chunk.css.map": "/static/css/2.2ae070eb.chunk.css.map",
"static/css/main.8c2979b3.chunk.css.map": "/static/css/main.8c2979b3.chunk.css.map",
"static/js/2.03f77681.chunk.js.LICENSE.txt": "/static/js/2.03f77681.chunk.js.LICENSE.txt",
"static/js/main.c0af4e5f.chunk.js.LICENSE.txt": "/static/js/main.c0af4e5f.chunk.js.LICENSE.txt",
"static/js/main.3b6cefda.chunk.js.LICENSE.txt": "/static/js/main.3b6cefda.chunk.js.LICENSE.txt",
"static/media/hysteresis.04ebd02c.png": "/static/media/hysteresis.04ebd02c.png"
},
"entrypoints": [
"static/js/runtime-main.4f1bbf1b.js",
"static/css/2.2ae070eb.chunk.css",
"static/js/2.03f77681.chunk.js",
"static/css/main.8c2979b3.chunk.css",
"static/js/main.c0af4e5f.chunk.js"
"static/js/main.3b6cefda.chunk.js"
]
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/main.3b6cefda.chunk.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion admin/static/js/main.c0af4e5f.chunk.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion admin/tab.html

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@
"Apollon77 <[email protected]>",
"AlCalzone"
],
"version": "5.0.8",
"version": "5.0.9",
"news": {
"5.0.9": {
"en": "fixed the error if no condition",
"de": "Der Fehler wurde behoben, wenn keine Bedingung vorliegt",
"ru": "исправлена ошибка при отсутствии условия",
"pt": "corrigiu o erro se nenhuma condição",
"nl": "de fout opgelost als er geen voorwaarde was",
"fr": "corrigé l'erreur si aucune condition",
"it": "risolto l'errore se nessuna condizione",
"es": "corrigió el error si no hay condición",
"pl": "naprawiono błąd, jeśli nie ma warunku",
"zh-cn": "如果没有条件,则修复错误"
},
"5.0.8": {
"en": "Translations\nAdded the \"set state with delay\" block",
"de": "Übersetzungen\nDer Block \"Status mit Verzögerung einstellen\" wurde hinzugefügt",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.javascript",
"version": "5.0.8",
"version": "5.0.9",
"description": "Rules Engine for ioBroker",
"author": "bluefox <[email protected]>",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js",
"version": "5.0.8",
"version": "5.0.9",
"private": true,
"dependencies": {
"@iobroker/adapter-react": "^1.6.2",
Expand Down
11 changes: 11 additions & 0 deletions src/src/Components/RulesEditor/components/Blocks/ConditionState.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class ConditionState extends GenericBlock {
if (value === null || value === undefined) {
value = false;
}

let result;
if (config.tagCard === '()') {
context.prelines = context.prelines || [];
Expand All @@ -68,6 +69,10 @@ class ConditionState extends GenericBlock {
if (value === '') {
value = 0;
}
if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {
value = `"${value}"`;
}

result = `__hysteresis((await getStateAsync("${config.oid}")).val, ${value}, __%%STATE%%__, ${config.hist}, "${config.histComp}")`;
}
} else
Expand All @@ -81,6 +86,9 @@ class ConditionState extends GenericBlock {
if (value === '') {
value = 0;
}
if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {
value = `"${value}"`;
}
result = `obj.state.val ${compare} ${value}`;
}
} else {
Expand All @@ -91,6 +99,9 @@ class ConditionState extends GenericBlock {
if (value === '') {
value = 0;
}
if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {
value = `"${value}"`;
}
result = `(await getStateAsync("${config.oid}")).val ${compare} ${value}`;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/src/Components/RulesEditor/helpers/Compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function compileConditions(conditions, context, blocks) {
let result = [];
let i = 0;
conditions && conditions.forEach(ors => {
if (ors.hasOwnProperty('length')) {
if (ors.hasOwnProperty('length') && ors.length) {
const _ors = [];
_ors && ors.forEach(block => {
const found = findBlock(block.id, blocks);
Expand All @@ -135,7 +135,6 @@ function compileConditions(conditions, context, blocks) {
result.push(found.compile(ors, context));
}
}

});

if (!result.length) {
Expand Down

0 comments on commit b06838b

Please sign in to comment.