From 295bbed4ae660eafe8f2ae2334fdae8d2dfa5858 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 21 Jul 2022 17:49:38 +0200 Subject: [PATCH] fix #581 --- src/devices/boiler.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index d108d27c5..bc5e18d11 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -675,17 +675,18 @@ void Boiler::process_UBAParameterWW(std::shared_ptr telegram) { has_bitupdate(telegram, wwChargeType_, 10, 0); // 0 = charge pump, 0xff = 3-way valve uint8_t wwComfort = EMS_VALUE_UINT_NOTSET; - telegram->read_value(wwComfort, 9); - if (wwComfort == 0) { - wwComfort = 0; // Hot - } else if (wwComfort == 0xD8) { - wwComfort = 1; // Eco - } else if (wwComfort == 0xEC) { - wwComfort = 2; // Intelligent - } else { - wwComfort = EMS_VALUE_UINT_NOTSET; + if (telegram->read_value(wwComfort, 9)) { + if (wwComfort == 0) { + wwComfort = 0; // Hot + } else if (wwComfort == 0xD8) { + wwComfort = 1; // Eco + } else if (wwComfort == 0xEC) { + wwComfort = 2; // Intelligent + } else { + wwComfort = EMS_VALUE_UINT_NOTSET; + } + has_update(wwComfort_, wwComfort); } - has_update(wwComfort_, wwComfort); } /* @@ -847,15 +848,16 @@ void Boiler::process_UBAParameterWWPlus(std::shared_ptr telegram has_update(telegram, wwChargeOptimization_, 25); uint8_t wwComfort1 = EMS_VALUE_UINT_NOTSET; - telegram->read_value(wwComfort1, 13); - if (wwComfort1 == 0) { - wwComfort1 = 0; // High_Comfort - } else if (wwComfort1 == 0xD8) { - wwComfort1 = 1; // Eco - } else { - wwComfort1 = EMS_VALUE_UINT_NOTSET; + if (telegram->read_value(wwComfort1, 13)) { + if (wwComfort1 == 0) { + wwComfort1 = 0; // High_Comfort + } else if (wwComfort1 == 0xD8) { + wwComfort1 = 1; // Eco + } else { + wwComfort1 = EMS_VALUE_UINT_NOTSET; + } + has_update(wwComfort1_, wwComfort1); } - has_update(wwComfort1_, wwComfort1); } // 0xE9 - WW monitor ems+