From c375232a5127fc8aaa9de3db7b693dc1fb957a2f Mon Sep 17 00:00:00 2001 From: fre4242 Date: Mon, 6 Feb 2023 18:04:49 +0100 Subject: [PATCH] added missing 'tempUpdHighLow' ButtonEvent handling; added *10 to setThermoDestTemp2 for PageThermo --- ioBroker/NsPanelTs.ts | 12 +++++++++++- ioBroker/NsPanelTs_without_Examples.ts | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index f9766f67..9d6c7df1 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -3819,7 +3819,8 @@ function GenerateThermoPage(page: PageThermo): Payload[] { let destTemp2 = ''; if (page.items[0].setThermoDestTemp2 != undefined) { - destTemp2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val; + let setValue2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val; + destTemp2 = '' + setValue2.toFixed(2) * 10; } let thermoPopup = 1; @@ -5121,6 +5122,15 @@ function HandleButtonEvent(words: any): void { case 'tempUpd': setIfExists(id + '.SET', parseInt(words[4]) / 10); break; + case 'tempUpdHighLow': + let temps = words[4].split('|'); + if (getState(id + '.ACTUAL2').val * 10 != parseInt(temps[1])) { // avoid writing if not needed + setIfExists(id + '.ACTUAL2', parseInt(temps[1]) / 10); + } + if (getState(id + '.SET').val * 10 != parseInt(temps[0])) { + setIfExists(id + '.SET', parseInt(temps[0]) / 10); + } + break; case 'media-back': setIfExists(id + '.PREV', true); break; diff --git a/ioBroker/NsPanelTs_without_Examples.ts b/ioBroker/NsPanelTs_without_Examples.ts index 4555353a..10524cd3 100644 --- a/ioBroker/NsPanelTs_without_Examples.ts +++ b/ioBroker/NsPanelTs_without_Examples.ts @@ -3437,7 +3437,8 @@ function GenerateThermoPage(page: PageThermo): Payload[] { let destTemp2 = ''; if (page.items[0].setThermoDestTemp2 != undefined) { - destTemp2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val; + let setValue2 = getState(id + '.' + page.items[0].setThermoDestTemp2).val; + destTemp2 = '' + setValue2.toFixed(2) * 10; } let thermoPopup = 1; @@ -4739,6 +4740,15 @@ function HandleButtonEvent(words: any): void { case 'tempUpd': setIfExists(id + '.SET', parseInt(words[4]) / 10); break; + case 'tempUpdHighLow': + let temps = words[4].split('|'); + if (getState(id + '.ACTUAL2').val * 10 != parseInt(temps[1])) { // avoid writing if not needed + setIfExists(id + '.ACTUAL2', parseInt(temps[1]) / 10); + } + if (getState(id + '.SET').val * 10 != parseInt(temps[0])) { + setIfExists(id + '.SET', parseInt(temps[0]) / 10); + } + break; case 'media-back': setIfExists(id + '.PREV', true); break;