Skip to content

Commit

Permalink
### 2.0.14 (2020-06-28)
Browse files Browse the repository at this point in the history
* (bluefox) GUI error corrected
  • Loading branch information
GermanBluefox committed Jun 28, 2020
1 parent f54b2ac commit 88ea52e
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 113 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ sendTo(
```
The adapter will read all actual values for IDs defined in this scene and save it as configured ones.

TODO:
Bereits gestartetet Befehle anhalten: ??
Verzügereung ab Szenenstart (ms):

Virtuelle Gruppe: Tooltip from Readme.md
Update selectID
## TODO:
- Change tooltip for "Bereits gestartetet Befehle anhalten": ??
- Update selectID dialog

## Changelog
### 2.0.14 (2020-06-28)
* (bluefox) GUI error corrected

### 2.0.13 (2020-06-27)
* (bluefox) Mobile view added

Expand Down
16 changes: 8 additions & 8 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"files": {
"main.css": "./static/css/main.d4bed9c6.chunk.css",
"main.js": "./static/js/main.a1f5cbcc.chunk.js",
"main.js.map": "./static/js/main.a1f5cbcc.chunk.js.map",
"main.js": "./static/js/main.e6428594.chunk.js",
"main.js.map": "./static/js/main.e6428594.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.8cdd9b0f.js",
"runtime-main.js.map": "./static/js/runtime-main.8cdd9b0f.js.map",
"static/css/2.9ba4c952.chunk.css": "./static/css/2.9ba4c952.chunk.css",
"static/js/2.2ce3caf9.chunk.js": "./static/js/2.2ce3caf9.chunk.js",
"static/js/2.2ce3caf9.chunk.js.map": "./static/js/2.2ce3caf9.chunk.js.map",
"static/js/2.f27d3636.chunk.js": "./static/js/2.f27d3636.chunk.js",
"static/js/2.f27d3636.chunk.js.map": "./static/js/2.f27d3636.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.4c10a4c5f4347af2c95a7f6764cee296.js": "./precache-manifest.4c10a4c5f4347af2c95a7f6764cee296.js",
"precache-manifest.20a435a68d6222948c128ec58b16b43f.js": "./precache-manifest.20a435a68d6222948c128ec58b16b43f.js",
"service-worker.js": "./service-worker.js",
"static/css/2.9ba4c952.chunk.css.map": "./static/css/2.9ba4c952.chunk.css.map",
"static/css/main.d4bed9c6.chunk.css.map": "./static/css/main.d4bed9c6.chunk.css.map",
"static/js/2.2ce3caf9.chunk.js.LICENSE.txt": "./static/js/2.2ce3caf9.chunk.js.LICENSE.txt"
"static/js/2.f27d3636.chunk.js.LICENSE.txt": "./static/js/2.f27d3636.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.8cdd9b0f.js",
"static/css/2.9ba4c952.chunk.css",
"static/js/2.2ce3caf9.chunk.js",
"static/js/2.f27d3636.chunk.js",
"static/css/main.d4bed9c6.chunk.css",
"static/js/main.a1f5cbcc.chunk.js"
"static/js/main.e6428594.chunk.js"
]
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "daf55467cda17d44679020fbb7a9eb10",
"revision": "78fe550f340ec0fafb08df38ad47bc6c",
"url": "./index.html"
},
{
"revision": "ba96ad6a95e780c362d9",
"revision": "e657c00ef00d66dee435",
"url": "./static/css/2.9ba4c952.chunk.css"
},
{
"revision": "12e572a009fbdf0a9f58",
"revision": "1ed96706f7c689ecfe34",
"url": "./static/css/main.d4bed9c6.chunk.css"
},
{
"revision": "ba96ad6a95e780c362d9",
"url": "./static/js/2.2ce3caf9.chunk.js"
"revision": "e657c00ef00d66dee435",
"url": "./static/js/2.f27d3636.chunk.js"
},
{
"revision": "3da521dbb4874350fb1d5ccbd1bab881",
"url": "./static/js/2.2ce3caf9.chunk.js.LICENSE.txt"
"url": "./static/js/2.f27d3636.chunk.js.LICENSE.txt"
},
{
"revision": "12e572a009fbdf0a9f58",
"url": "./static/js/main.a1f5cbcc.chunk.js"
"revision": "1ed96706f7c689ecfe34",
"url": "./static/js/main.e6428594.chunk.js"
},
{
"revision": "7efe789d81385b014df3",
Expand Down
2 changes: 1 addition & 1 deletion admin/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"./precache-manifest.4c10a4c5f4347af2c95a7f6764cee296.js"
"./precache-manifest.20a435a68d6222948c128ec58b16b43f.js"
);

self.addEventListener('message', (event) => {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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

This file was deleted.

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/tab.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><link rel="stylesheet" href="./style.css"/><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" src="./../../lib/js/socket.io.js"></script><title>Scenes [ioBroker]</title><link href="./static/css/2.9ba4c952.chunk.css" rel="stylesheet"><link href="./static/css/main.d4bed9c6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(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 a=this["webpackJsonpscenes-react"]=this["webpackJsonpscenes-react"]||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=c;t()}([])</script><script src="./static/js/2.2ce3caf9.chunk.js"></script><script src="./static/js/main.a1f5cbcc.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><link rel="stylesheet" href="./style.css"/><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" src="./../../lib/js/socket.io.js"></script><title>Scenes [ioBroker]</title><link href="./static/css/2.9ba4c952.chunk.css" rel="stylesheet"><link href="./static/css/main.d4bed9c6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(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 a=this["webpackJsonpscenes-react"]=this["webpackJsonpscenes-react"]||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=c;t()}([])</script><script src="./static/js/2.f27d3636.chunk.js"></script><script src="./static/js/main.e6428594.chunk.js"></script></body></html>
45 changes: 13 additions & 32 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "scenes",
"version": "2.0.13",
"version": "2.0.14",
"news": {
"2.0.14": {
"en": "GUI error corrected",
"de": "GUI-Fehler behoben",
"ru": "Исправлена ошибка графического интерфейса",
"pt": "Erro na GUI corrigido",
"nl": "GUI-fout gecorrigeerd",
"fr": "Erreur GUI corrigée",
"it": "Errore della GUI corretto",
"es": "Error de GUI corregido",
"pl": "Poprawiony błąd GUI",
"zh-cn": "界面错误已更正"
},
"2.0.13": {
"en": "Mobile view added",
"de": "Mobile Ansicht hinzugefügt",
Expand Down Expand Up @@ -86,37 +98,6 @@
"es": "Agregado almacenamiento de valores reales en escena a través del mensaje.",
"pl": "Dodano zapisywanie rzeczywistych wartości w scenie za pomocą wiadomości",
"zh-cn": "添加了通过消息在场景中存储实际值"
},
"1.1.0": {
"en": "Works now with Admin3",
"de": "Funktioniert jetzt mit Admin3",
"ru": "Работает теперь с Admin3",
"pt": "Funciona agora com o Admin3",
"nl": "Werkt nu met Admin3",
"fr": "Fonctionne maintenant avec Admin3",
"it": "Funziona ora con Admin3",
"es": "Funciona ahora con Admin3",
"pl": "Działa teraz z Admin3"
},
"1.0.2": {
"en": "use new select ID dialog",
"de": "Benutze neues Select ID Dialog",
"ru": "Используется новый диалог выбора объектов"
},
"1.0.0": {
"en": "fix false scenes",
"de": "Korrigiere false Szenen",
"ru": "Исправлены false сцены"
},
"0.2.7": {
"en": "Support of iobroker.pro",
"de": "Unterstützung von iobroker.pro",
"ru": "Поддержка iobroker.pro"
},
"0.2.6": {
"en": "add read/write settings to scene object",
"de": "add read/write settings to scene object",
"ru": "add read/write settings to scene object"
}
},
"title": "Scenes",
Expand Down
70 changes: 42 additions & 28 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,24 @@ function checkTrigger(sceneId, stateId, state, isTrue) {
switch (trigger.condition) {
case undefined:
case '==':
if (val == stateVal) activateScene(sceneId, isTrue);
if (val == stateVal) {
activateScene(sceneId, isTrue);
}
break;

case '!=':
if (val != stateVal) activateScene(sceneId, isTrue);
if (val != stateVal) {
activateScene(sceneId, isTrue);
}
break;

case '>':
fVal = parseFloat(val);
aVal = parseFloat(state.val);
if (fVal.toString() == val && stateVal === aVal.toString()) {
if (aVal > fVal) activateScene(sceneId, isTrue);
if (aVal > fVal) {
activateScene(sceneId, isTrue);
}
} else
if (val > state.val.toString()) {
activateScene(sceneId, isTrue);
Expand All @@ -404,7 +410,9 @@ function checkTrigger(sceneId, stateId, state, isTrue) {
fVal = parseFloat(val);
aVal = parseFloat(state.val);
if (fVal.toString() == val && stateVal === aVal.toString()) {
if (aVal < fVal) activateScene(sceneId, isTrue);
if (aVal < fVal) {
activateScene(sceneId, isTrue);
}
} else
if (val < state.val.toString()) {
activateScene(sceneId, isTrue);
Expand All @@ -415,7 +423,9 @@ function checkTrigger(sceneId, stateId, state, isTrue) {
fVal = parseFloat(val);
aVal = parseFloat(state.val);
if (fVal.toString() == val && stateVal === aVal.toString()) {
if (aVal >= fVal) activateScene(sceneId, isTrue);
if (aVal >= fVal) {
activateScene(sceneId, isTrue);
}
} else
if (val >= state.val.toString()) {
activateScene(sceneId, isTrue);
Expand All @@ -426,7 +436,9 @@ function checkTrigger(sceneId, stateId, state, isTrue) {
fVal = parseFloat(val);
aVal = parseFloat(state.val);
if (fVal.toString() == val && stateVal === aVal.toString()) {
if (aVal <= fVal) activateScene(sceneId, isTrue);
if (aVal <= fVal) {
activateScene(sceneId, isTrue);
}
} else
if (val <= state.val.toString()) {
activateScene(sceneId, isTrue);
Expand Down Expand Up @@ -461,9 +473,7 @@ function activateSceneState(sceneId, state, isTrue) {

if (stateObj.stopAllDelays && timers[stateObj.id].length) {
adapter.log.debug('Cancel running timers (' + timers[stateObj.id].length + ' for ' + stateObj.id);
for (let tt = 0; tt < timers[stateObj.id].length; tt++) {
clearTimeout(timers[stateObj.id][tt].timer);
}
timers[stateObj.id].forEach(item => clearTimeout(item.timer));
timers[stateObj.id] = [];
}
tIndex++;
Expand Down Expand Up @@ -499,9 +509,7 @@ function activateSceneState(sceneId, state, isTrue) {
} else {
if (stateObj.stopAllDelays && timers[stateObj.id] && timers[stateObj.id].length) {
adapter.log.debug(`Cancel running timers for "${stateObj.id}" (${timers[stateObj.id].length})`);
for (let t = 0; t < timers[stateObj.id].length; t++) {
clearTimeout(timers[stateObj.id][t].timer);
}
timers[stateObj.id].forEach(item => clearTimeout(item.timer));
timers[stateObj.id] = [];
}
// Set desired state
Expand Down Expand Up @@ -615,11 +623,12 @@ function initTrueFalse(sceneId, isTrue) {
}
// initiate cron tasks
if (sStruct.cron) {
if (!schedule) schedule = require('node-schedule');
schedule = schedule || require('node-schedule');

adapter.log.debug(`Initiate cron task for ${sceneId}(${isTrue}): ${sStruct.cron}`);

adapter.log.debug('Initiate cron task for ' + sceneId + '(' + isTrue + ') : ' + sStruct.cron);
cronTasks[sceneId] = schedule.scheduleJob(sStruct.cron, () => {
adapter.log.debug('cron for ' + sceneId + '(' + isTrue + ') : ' + sStruct.cron);
adapter.log.debug(`cron for ${sceneId}(${isTrue}): ${sStruct.cron}`);
activateScene(sceneId, isTrue);
});
}
Expand All @@ -632,7 +641,9 @@ function initScenes() {

// list all scenes in Object
for (const sceneId in scenes) {
if (!scenes.hasOwnProperty(sceneId)) continue;
if (!scenes.hasOwnProperty(sceneId)) {
continue;
}

scenes[sceneId].count = 0;
scenes[sceneId].value = {val: null, ack: true}; // default state
Expand All @@ -641,7 +652,9 @@ function initScenes() {
for (let state = 0; state < scenes[sceneId].native.members.length; state++) {
const stateId = scenes[sceneId].native.members[state].id;
// calculate subscriptions
if (countIds.indexOf(stateId) === -1) countIds.push(stateId);
if (!countIds.includes(stateId)) {
countIds.push(stateId);
}

// remember which scenes uses this state
ids[stateId] = ids[stateId] || [];
Expand All @@ -651,7 +664,7 @@ function initScenes() {
if (scenes[sceneId].native.members[state].delay) {
const delay = parseInt(scenes[sceneId].native.members[state].delay, 10);
if (scenes[sceneId].native.members[state].delay != delay.toString()) {
adapter.log.error('Invalid delay for scene "' + sceneId + '": ' + scenes[sceneId].native.members[state].delay);
adapter.log.error(`Invalid delay for scene "${sceneId}": ${scenes[sceneId].native.members[state].delay}`);
scenes[sceneId].native.members[state].delay = 0;
} else {
scenes[sceneId].native.members[state].delay = delay;
Expand All @@ -671,35 +684,30 @@ function initScenes() {
// read actual state
getState(sceneId, state);
}

if (scenes[sceneId].native.onTrue && scenes[sceneId].native.onTrue.trigger) {
if (scenes[sceneId].native.onTrue.trigger.value === null || scenes[sceneId].native.onTrue.trigger.value === undefined) {
scenes[sceneId].native.onTrue.trigger.value = '';
} else {
scenes[sceneId].native.onTrue.trigger.value = scenes[sceneId].native.onTrue.trigger.value.toString();
}
}

if (scenes[sceneId].native.onFalse && scenes[sceneId].native.onFalse.trigger) {
if (scenes[sceneId].native.onFalse.trigger.value === null || scenes[sceneId].native.onFalse.trigger.value === undefined) {
scenes[sceneId].native.onFalse.trigger.value = '';
} else {
scenes[sceneId].native.onFalse.trigger.value = scenes[sceneId].native.onFalse.trigger.value.toString();
}
}

// Init trigger, cron and astro for onTrue
let usedIds = initTrueFalse(sceneId, true);
if (usedIds) {
for (let k = 0; k < usedIds.length; k++) {
if (countIds.indexOf(usedIds[k]) === -1) countIds.push(usedIds[k]);
}
}
usedIds && usedIds.forEach(id => !countIds.includes(id) && countIds.push(id));

// Init trigger, cron and astro for onFalse
usedIds = initTrueFalse(sceneId, false);
if (usedIds) {
for (let k = 0; k < usedIds.length; k++) {
if (countIds.indexOf(usedIds[k]) === -1) countIds.push(usedIds[k]);
}
}
usedIds && usedIds.forEach(id => !countIds.includes(id) && countIds.push(id));
}

// If requested more than 20 ids => get all of them
Expand Down Expand Up @@ -739,6 +747,12 @@ function main() {

scenes[id] = states[id];

// rename attribute
if (scenes[id].native.burstIntervall !== undefined) {
scenes[id].native.burstInterval = scenes[id].native.burstIntervall;
delete scenes[id].native.burstIntervall;
}

// Remove all disabled scenes
for (let m = states[id].native.members.length - 1; m >= 0; m--) {
if (!scenes[id].native.members[m] || states[id].native.members[m].disabled) {
Expand Down
Loading

0 comments on commit 88ea52e

Please sign in to comment.