Skip to content

Commit 06e9b8d

Browse files
committed
round energy values to full kWh
1 parent b912779 commit 06e9b8d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/devices/boiler.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
871871
}
872872
store_energy();
873873
// update/publish the values
874-
has_update(nrgHeat_, (uint32_t)nrgHeatF_);
875-
has_update(nrgWw_, (uint32_t)nrgWwF_);
874+
has_update(nrgHeat_, (uint32_t)(nrgHeatF_ + 0.5));
875+
has_update(nrgWw_, (uint32_t)(nrgWwF_ + 0.5));
876876
has_update(&nomPower_);
877877
}
878878
}
@@ -942,8 +942,8 @@ void Boiler::check_active() {
942942
// resolution needed: 0.01 Wh = 0.01 Ws / 3600 = (% * kW * ms) / 3600
943943
nrgHeatF_ += (double_t)(((uint32_t)heatBurnPow * nomPower_ * (uuid::get_uptime() - powLastReadTime_)) / 3600) / 100000UL;
944944
nrgWwF_ += (double_t)(((uint32_t)wwBurnPow * nomPower_ * (uuid::get_uptime() - powLastReadTime_)) / 3600) / 100000UL;
945-
has_update(nrgHeat_, (uint32_t)(nrgHeatF_));
946-
has_update(nrgWw_, (uint32_t)(nrgWwF_));
945+
has_update(nrgHeat_, (uint32_t)(nrgHeatF_ + 0.5));
946+
has_update(nrgWw_, (uint32_t)(nrgWwF_ + 0.5));
947947
// check for store values
948948
time_t now = time(nullptr);
949949
tm * tm_ = localtime(&now);

src/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define EMSESP_APP_VERSION "3.6.1-dev.0c"
1+
#define EMSESP_APP_VERSION "3.6.1-dev.0d"

0 commit comments

Comments
 (0)