Skip to content

Commit 0666b57

Browse files
committed
### 2.0.10 (2020-06-20)
* (bluefox) Added "Do not overwrite state if it has the required value" option
1 parent 5516738 commit 0666b57

30 files changed

+252
-119
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ sendTo(
107107
The adapter will read all actual values for IDs defined in this scene and save it as configured ones.
108108

109109
## Changelog
110+
### 2.0.10 (2020-06-20)
111+
* (bluefox) Added "Do not overwrite state if it has the required value" option
112+
110113
### 2.0.9 (2020-06-17)
111114
* (bluefox) The colors are corrected
112115

admin/asset-manifest.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"files": {
33
"main.css": "./static/css/main.d4bed9c6.chunk.css",
4-
"main.js": "./static/js/main.b344d9cb.chunk.js",
5-
"main.js.map": "./static/js/main.b344d9cb.chunk.js.map",
4+
"main.js": "./static/js/main.8c72441e.chunk.js",
5+
"main.js.map": "./static/js/main.8c72441e.chunk.js.map",
66
"runtime-main.js": "./static/js/runtime-main.8cdd9b0f.js",
77
"runtime-main.js.map": "./static/js/runtime-main.8cdd9b0f.js.map",
88
"static/css/2.9ba4c952.chunk.css": "./static/css/2.9ba4c952.chunk.css",
9-
"static/js/2.cafef96c.chunk.js": "./static/js/2.cafef96c.chunk.js",
10-
"static/js/2.cafef96c.chunk.js.map": "./static/js/2.cafef96c.chunk.js.map",
9+
"static/js/2.7adffe7b.chunk.js": "./static/js/2.7adffe7b.chunk.js",
10+
"static/js/2.7adffe7b.chunk.js.map": "./static/js/2.7adffe7b.chunk.js.map",
1111
"index.html": "./index.html",
12-
"precache-manifest.435bc6ed659653c95c4cc7f3f6321d03.js": "./precache-manifest.435bc6ed659653c95c4cc7f3f6321d03.js",
12+
"precache-manifest.d83f2371a2d3f7e50560790a815198bd.js": "./precache-manifest.d83f2371a2d3f7e50560790a815198bd.js",
1313
"service-worker.js": "./service-worker.js",
1414
"static/css/2.9ba4c952.chunk.css.map": "./static/css/2.9ba4c952.chunk.css.map",
1515
"static/css/main.d4bed9c6.chunk.css.map": "./static/css/main.d4bed9c6.chunk.css.map",
16-
"static/js/2.cafef96c.chunk.js.LICENSE.txt": "./static/js/2.cafef96c.chunk.js.LICENSE.txt"
16+
"static/js/2.7adffe7b.chunk.js.LICENSE.txt": "./static/js/2.7adffe7b.chunk.js.LICENSE.txt"
1717
},
1818
"entrypoints": [
1919
"static/js/runtime-main.8cdd9b0f.js",
2020
"static/css/2.9ba4c952.chunk.css",
21-
"static/js/2.cafef96c.chunk.js",
21+
"static/js/2.7adffe7b.chunk.js",
2222
"static/css/main.d4bed9c6.chunk.css",
23-
"static/js/main.b344d9cb.chunk.js"
23+
"static/js/main.8c72441e.chunk.js"
2424
]
2525
}

admin/precache-manifest.435bc6ed659653c95c4cc7f3f6321d03.js renamed to admin/precache-manifest.d83f2371a2d3f7e50560790a815198bd.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
self.__precacheManifest = (self.__precacheManifest || []).concat([
22
{
3-
"revision": "9f750da1f52ab59ce6fd6ed06aeb8739",
3+
"revision": "f94da838fa37bde34c356e8a904f65e6",
44
"url": "./index.html"
55
},
66
{
7-
"revision": "976f1d8e61d56c138e70",
7+
"revision": "bac404d6148f4a085f0f",
88
"url": "./static/css/2.9ba4c952.chunk.css"
99
},
1010
{
11-
"revision": "f28b7945543733bb9c22",
11+
"revision": "2a93a3dd0bf6029e84b1",
1212
"url": "./static/css/main.d4bed9c6.chunk.css"
1313
},
1414
{
15-
"revision": "976f1d8e61d56c138e70",
16-
"url": "./static/js/2.cafef96c.chunk.js"
15+
"revision": "bac404d6148f4a085f0f",
16+
"url": "./static/js/2.7adffe7b.chunk.js"
1717
},
1818
{
1919
"revision": "799f3d5c27694f0f3c92bbc8286bf099",
20-
"url": "./static/js/2.cafef96c.chunk.js.LICENSE.txt"
20+
"url": "./static/js/2.7adffe7b.chunk.js.LICENSE.txt"
2121
},
2222
{
23-
"revision": "f28b7945543733bb9c22",
24-
"url": "./static/js/main.b344d9cb.chunk.js"
23+
"revision": "2a93a3dd0bf6029e84b1",
24+
"url": "./static/js/main.8c72441e.chunk.js"
2525
},
2626
{
2727
"revision": "7efe789d81385b014df3",

admin/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
1515

1616
importScripts(
17-
"./precache-manifest.435bc6ed659653c95c4cc7f3f6321d03.js"
17+
"./precache-manifest.d83f2371a2d3f7e50560790a815198bd.js"
1818
);
1919

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

admin/static/js/2.7adffe7b.chunk.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/static/js/2.cafef96c.chunk.js.map renamed to admin/static/js/2.7adffe7b.chunk.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/static/js/2.cafef96c.chunk.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

admin/static/js/main.8c72441e.chunk.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/static/js/main.8c72441e.chunk.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/static/js/main.b344d9cb.chunk.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

admin/static/js/main.b344d9cb.chunk.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

admin/tab.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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.cafef96c.chunk.js"></script><script src="./static/js/main.b344d9cb.chunk.js"></script></body></html>
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.7adffe7b.chunk.js"></script><script src="./static/js/main.8c72441e.chunk.js"></script></body></html>

io-package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
{
22
"common": {
33
"name": "scenes",
4-
"version": "2.0.9",
4+
"version": "2.0.10",
55
"news": {
6+
"2.0.10": {
7+
"en": "Added \"Do not overwrite state if it has the required value\" option",
8+
"de": "Option \"Status nicht überschreiben, wenn er den erforderlichen Wert hat\" hinzugefügt",
9+
"ru": "Добавлена опция «Не перезаписывать состояние, если оно имеет требуемое значение»",
10+
"pt": "Adicionada a opção \"Não substituir o estado se ele tiver o valor necessário\"",
11+
"nl": "\"Overschrijf status niet als het de vereiste waarde heeft\" optie toegevoegd",
12+
"fr": "Ajout de l'option \"Ne pas écraser l'état s'il a la valeur requise\"",
13+
"it": "Aggiunta l'opzione \"Non sovrascrivere lo stato se ha il valore richiesto\"",
14+
"es": "Se agregó la opción \"No sobrescribir estado si tiene el valor requerido\"",
15+
"pl": "Dodano opcję „Nie zastępuj stanu, jeśli ma wymaganą wartość”",
16+
"zh-cn": "添加了“如果具有必需的值,请勿覆盖状态”选项"
17+
},
618
"2.0.9": {
719
"en": "The colors are corrected",
820
"de": "Die Farben werden korrigiert",

main.js

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,18 @@ function activateSceneState(sceneId, state, isTrue) {
468468
// Start timeout
469469
const timer = setTimeout((id, setValue, _tIndex) => {
470470
adapter.log.debug('Set delayed state for "' + sceneId + '": ' + id + ' = ' + setValue);
471-
// execute timeout
472-
adapter.getForeignState(id, (err, state) => {
473-
// Set new state only if differ from desired state
474-
if (!state || state.val !== setValue) {
475-
adapter.setForeignState(id, setValue);
476-
}
477-
});
478471

472+
// execute timeout
473+
if (stateObj.doNotOverwrite) {
474+
adapter.getForeignState(id, (err, state) => {
475+
// Set new state only if differ from desired state
476+
if (!state || state.val !== setValue) {
477+
adapter.setForeignState(id, setValue);
478+
}
479+
});
480+
} else {
481+
adapter.setForeignState(id, setValue);
482+
}
479483

480484
if (timers[id]) {
481485
// remove timer from the list
@@ -497,13 +501,17 @@ function activateSceneState(sceneId, state, isTrue) {
497501
}
498502
timers[stateObj.id] = [];
499503
}
500-
// execute timeout
501-
adapter.getForeignState(stateObj.id, (err, state) => {
502-
// Set new state only if differ from desired state
503-
if (!state || state.val !== desiredValue) {
504-
adapter.setForeignState(stateObj.id, desiredValue);
505-
}
506-
});
504+
// Set desired state
505+
if (stateObj.doNotOverwrite) {
506+
adapter.getForeignState(stateObj.id, (err, state) => {
507+
// Set new state only if differ from desired state
508+
if (!state || state.val !== desiredValue) {
509+
adapter.setForeignState(stateObj.id, desiredValue);
510+
}
511+
});
512+
} else {
513+
adapter.setForeignState(stateObj.id, desiredValue);
514+
}
507515
}
508516
}
509517

@@ -573,7 +581,9 @@ function getState(sceneId, stateNumber, callback) {
573581
const stateId = scenes[sceneId].native.members[stateNumber].id;
574582
adapter.getForeignState(stateId, (err, state) => {
575583
// possible scene was renamed
576-
if (!scenes[sceneId]) return;
584+
if (!scenes[sceneId]) {
585+
return;
586+
}
577587

578588
scenes[sceneId].native.members[stateNumber].actual = state ? state.val : null;
579589
// If processing finshed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iobroker.scenes",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"description": "Scenes for ioBroker.",
55
"author": {
66
"name": "bluefox",

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scenes-react",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"private": true,
55
"dependencies": {
66
"@iobroker/adapter-react": "^1.0.5",

0 commit comments

Comments
 (0)