From 06e9b8d303da691166be78aa1c91a8ce73278d15 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 4 Sep 2023 13:11:23 +0200 Subject: [PATCH] round energy values to full kWh --- src/devices/boiler.cpp | 8 ++++---- src/version.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 3264f3002..18803a585 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -871,8 +871,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const } store_energy(); // update/publish the values - has_update(nrgHeat_, (uint32_t)nrgHeatF_); - has_update(nrgWw_, (uint32_t)nrgWwF_); + has_update(nrgHeat_, (uint32_t)(nrgHeatF_ + 0.5)); + has_update(nrgWw_, (uint32_t)(nrgWwF_ + 0.5)); has_update(&nomPower_); } } @@ -942,8 +942,8 @@ void Boiler::check_active() { // resolution needed: 0.01 Wh = 0.01 Ws / 3600 = (% * kW * ms) / 3600 nrgHeatF_ += (double_t)(((uint32_t)heatBurnPow * nomPower_ * (uuid::get_uptime() - powLastReadTime_)) / 3600) / 100000UL; nrgWwF_ += (double_t)(((uint32_t)wwBurnPow * nomPower_ * (uuid::get_uptime() - powLastReadTime_)) / 3600) / 100000UL; - has_update(nrgHeat_, (uint32_t)(nrgHeatF_)); - has_update(nrgWw_, (uint32_t)(nrgWwF_)); + has_update(nrgHeat_, (uint32_t)(nrgHeatF_ + 0.5)); + has_update(nrgWw_, (uint32_t)(nrgWwF_ + 0.5)); // check for store values time_t now = time(nullptr); tm * tm_ = localtime(&now); diff --git a/src/version.h b/src/version.h index 713c08869..4865f5bec 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.1-dev.0c" +#define EMSESP_APP_VERSION "3.6.1-dev.0d"