Skip to content

Commit

Permalink
Merge pull request #36 from DEV2DEV-DE/patch-1
Browse files Browse the repository at this point in the history
Subscribe on updates of both values (temperature, humidity) in …
  • Loading branch information
GermanBluefox authored Sep 7, 2023
2 parents 5b183ba + 49c4592 commit 6495253
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions widgets/vis-material-advanced/js/vis-material-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,13 @@ vis.binds["vis-material-advanced"] = {


if (data.oid) {
// subscribe on updates of value
// subscribe on updates of temperature value
vis.states.bind(data.oid + '.val', function (e, newVal, oldVal) {
update(newVal);
update(newVal, vis.states[data.oid2 + '.val']);
});
// subscribe on updates of humidity value
vis.states.bind(data.oid2 + '.val', function (e, newVal, oldVal) {
update(vis.states[data.oid + '.val'], newVal);
});

// set current value
Expand Down Expand Up @@ -1563,4 +1567,4 @@ vis.binds['vis-material-advanced'].showVersion();
// divList.push = '</div><div class="vma_subtitle" style=" color: '+$text_color+';font-size: '+$subtitle_size+' ">';
// divList.push = $subtitle +'</div></div>';
// return {widget: divList.join('')}
// }
// }

0 comments on commit 6495253

Please sign in to comment.