Skip to content

Commit 9946755

Browse files
committed
check each single nvs values before writing it
1 parent 2e25e46 commit 9946755

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/devices/boiler.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -895,13 +895,16 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
895895

896896
void Boiler::store_energy() {
897897
// only write if something is changed
898-
if (nrgHeatF_ != EMSESP::nvs_.getDouble(FL_(nrgHeat)[0]) || nrgWwF_ != EMSESP::nvs_.getDouble(FL_(nrgWw)[0])
899-
|| nomPower_ != EMSESP::nvs_.getUChar(FL_(nomPower)[0])) {
898+
if (nrgHeatF_ != EMSESP::nvs_.getDouble(FL_(nrgHeat)[0])) {
900899
EMSESP::nvs_.putDouble(FL_(nrgHeat)[0], nrgHeatF_);
900+
}
901+
if (nrgWwF_ != EMSESP::nvs_.getDouble(FL_(nrgWw)[0])) {
901902
EMSESP::nvs_.putDouble(FL_(nrgWw)[0], nrgWwF_);
903+
}
904+
if (nomPower_ != EMSESP::nvs_.getUChar(FL_(nomPower)[0])) {
902905
EMSESP::nvs_.putUChar(FL_(nomPower)[0], nomPower_);
903-
LOG_DEBUG("energy values stored");
904906
}
907+
// LOG_DEBUG("energy values stored");
905908
}
906909

907910
// Check if hot tap water or heating is active

0 commit comments

Comments
 (0)