Skip to content

Commit

Permalink
### 2.0.1 (2019-06-13)
Browse files Browse the repository at this point in the history
* (bluefox) New GUI based on react
  • Loading branch information
GermanBluefox committed Jun 13, 2020
1 parent 4659029 commit e9070d6
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sendTo(
The adapter will read all actual values for IDs defined in this scene and save it as configured ones.

## Changelog
### 2.0.0 (2019-05-26)
### 2.0.1 (2019-06-13)
* (bluefox) New GUI based on react

### 1.1.1 (2019-05-26)
Expand Down
8 changes: 4 additions & 4 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "./static/css/main.d4bed9c6.chunk.css",
"main.js": "./static/js/main.03719948.chunk.js",
"main.js.map": "./static/js/main.03719948.chunk.js.map",
"main.js": "./static/js/main.7e2a3f00.chunk.js",
"main.js.map": "./static/js/main.7e2a3f00.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.81b5e61b.chunk.js": "./static/js/2.81b5e61b.chunk.js",
"static/js/2.81b5e61b.chunk.js.map": "./static/js/2.81b5e61b.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.22cd2017613916389e22b62c8676646e.js": "./precache-manifest.22cd2017613916389e22b62c8676646e.js",
"precache-manifest.ca572777f78efc82209ab7d733124f20.js": "./precache-manifest.ca572777f78efc82209ab7d733124f20.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",
Expand All @@ -20,6 +20,6 @@
"static/css/2.9ba4c952.chunk.css",
"static/js/2.81b5e61b.chunk.js",
"static/css/main.d4bed9c6.chunk.css",
"static/js/main.03719948.chunk.js"
"static/js/main.7e2a3f00.chunk.js"
]
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "b55f985f177ff2916e9331be28d980e9",
"revision": "3eb7bfda5385ab26bd6074a01edb3b14",
"url": "./index.html"
},
{
"revision": "677ef5db4a3e0b5f72ea",
"url": "./static/css/2.9ba4c952.chunk.css"
},
{
"revision": "ff5ce2b2ff3da0949503",
"revision": "fc9a26acf126e52fc60e",
"url": "./static/css/main.d4bed9c6.chunk.css"
},
{
Expand All @@ -20,8 +20,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "./static/js/2.81b5e61b.chunk.js.LICENSE.txt"
},
{
"revision": "ff5ce2b2ff3da0949503",
"url": "./static/js/main.03719948.chunk.js"
"revision": "fc9a26acf126e52fc60e",
"url": "./static/js/main.7e2a3f00.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.22cd2017613916389e22b62c8676646e.js"
"./precache-manifest.ca572777f78efc82209ab7d733124f20.js"
);

self.addEventListener('message', (event) => {
Expand Down
1 change: 0 additions & 1 deletion admin/static/js/main.03719948.chunk.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/main.7e2a3f00.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.81b5e61b.chunk.js"></script><script src="./static/js/main.03719948.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.81b5e61b.chunk.js"></script><script src="./static/js/main.7e2a3f00.chunk.js"></script></body></html>
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"common": {
"name": "scenes",
"version": "2.0.0",
"version": "2.0.1",
"news": {
"2.0.0": {
"2.0.1": {
"en": "New GUI based on react",
"de": "Neue GUI basierend auf react",
"ru": "Новый графический интерфейс, основанный на react",
Expand Down
41 changes: 31 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ let tIndex = 1; // never ending counter
// Set one state of the scene
function activateSceneState(sceneId, state, isTrue) {
const stateObj = scenes[sceneId].native.members[state];

let desiredValue;
if (!scenes[sceneId].native.virtualGroup) {
isTrue = isTrue ? stateObj.setIfTrue : stateObj.setIfFalse;
desiredValue = isTrue ? stateObj.setIfTrue : stateObj.setIfFalse;
}

if (stateObj.delay) {
Expand All @@ -451,7 +451,13 @@ function activateSceneState(sceneId, state, isTrue) {
const timer = setTimeout((id, setValue, _tIndex) => {
adapter.log.debug('Set delayed state for "' + sceneId + '": ' + id + ' = ' + setValue);
// execute timeout
adapter.setForeignState(id, setValue);
adapter.getForeignState(id, (err, state) => {
// Set new state only if differ from desired state
if (!state || state.val !== setValue) {
adapter.setForeignState(id, setValue);
}
});


if (timers[id]) {
// remove timer from the list
Expand All @@ -462,18 +468,24 @@ function activateSceneState(sceneId, state, isTrue) {
}
}
}
}, stateObj.delay, stateObj.id, isTrue, tIndex);
}, stateObj.delay, stateObj.id, desiredValue, tIndex);

timers[stateObj.id].push({timer, tIndex});
} else {
if (stateObj.stopAllDelays && timers[stateObj.id] && timers[stateObj.id].length) {
adapter.log.debug('Cancel running timers for "' + 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] = [];
}
adapter.setForeignState(stateObj.id, isTrue);
// execute timeout
adapter.getForeignState(stateObj.id, (err, state) => {
// Set new state only if differ from desired state
if (!state || state.val !== desiredValue) {
adapter.setForeignState(stateObj.id, desiredValue);
}
});
}
}

Expand Down Expand Up @@ -680,19 +692,28 @@ function main() {
if (states) {
for (const id in states) {
// ignore if no states involved
if (!states.hasOwnProperty(id) || !states[id].native || !states[id].native.members || !states[id].native.members.length) continue;
if (!states.hasOwnProperty(id) || !states[id].native || !states[id].native.members || !states[id].native.members.length) {
continue;
}
//ignore if scene is disabled
if (!states[id].common.enabled) continue;
if (!states[id].common.enabled) {
continue;
}
// ignore if another instance
if (states[id].common.engine !== 'system.adapter.' + adapter.namespace) continue;
if (states[id].common.engine !== 'system.adapter.' + adapter.namespace) {
continue;
}

scenes[id] = states[id];

// 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) {
scenes[id].native.members.splice(m, 1);
}

// Reset actual state
scenes[id].native.members[m].actual = null;
if (states[id].native.members[m].disabled) scenes[id].native.members.splice(m, 1);
}
}
}
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.scenes",
"version": "2.0.0",
"version": "2.0.1",
"description": "Scenes for ioBroker.",
"author": {
"name": "bluefox",
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": "scenes-react",
"version": "2.0.0",
"version": "2.0.1",
"private": true,
"dependencies": {
"@iobroker/adapter-react": "^1.0.2",
Expand Down

0 comments on commit e9070d6

Please sign in to comment.