v3.9.0.3 - Pull Request #754 by @fre4242

added missing 'tempUpdHighLow' ButtonEvent handling
This commit is contained in:
Armilar
2023-02-06 20:04:06 +01:00
committed by GitHub
2 changed files with 26 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
TypeScript v3.9.0.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf
TypeScript v3.9.0.3 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf
- abgestimmt auf TFT 49 / v3.9.0 / BerryDriver 8 / Tasmota 12.3.1
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts
@@ -97,6 +97,7 @@ ReleaseNotes:
- 28.01.2023 - v3.9.0 Fix TFT-Version Path in function update_tft_firmware (drop ".")
- 29.01.2023 - v3.9.0 Upgrade TFT 49
- 03.02.2023 - v3.9.0.2 Hotfix Screensaver bExit
- 06.02.2023 - v3.9.0.3 PR #754 - added missing 'tempUpdHighLow' ButtonEvent handling - by @fre4242
Todo Next Release
- XX.XX.2023 - v4.0.0 Add cardUnlock
@@ -3819,7 +3820,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 +5123,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;

View File

@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
TypeScript v3.9.0.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf
TypeScript v3.9.0.3 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf
- abgestimmt auf TFT 49 / v3.9.0 / BerryDriver 8 / Tasmota 12.3.1
@joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts
@@ -97,6 +97,7 @@ ReleaseNotes:
- 28.01.2023 - v3.9.0 Fix TFT-Version Path in function update_tft_firmware (drop ".")
- 29.01.2023 - v3.9.0 Upgrade TFT 49
- 03.02.2023 - v3.9.0.2 Hotfix Screensaver bExit
- 06.02.2023 - v3.9.0.3 PR #754 - added missing 'tempUpdHighLow' ButtonEvent handling - by @fre4242
Todo Next Release
- XX.XX.2023 - v4.0.0 Add cardUnlock
@@ -3437,7 +3438,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 +4741,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;