diff --git a/CHANGELOG.md b/CHANGELOG.md index 699fa62f3b4a..b5671627d870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file. - ESP32-C3 ledlink functionality regression from v13.1.0.2 - Berry parser error in specific cases (#20059) - ``changeUIntScale`` for linearity when expanding range (#20089) +- ESP32 remove restart energy logging if no energy monitoring is selected ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 35db20fb804e..cf3bc718a5d5 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -166,6 +166,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Zero-Cross Dimmer for ESP32 with Core3 [#19929](https://github.com/arendst/Tasmota/issues/19929) - ``changeUIntScale`` for linearity when expanding range [#20089](https://github.com/arendst/Tasmota/issues/20089) - ESP32 I2C allow bus2 support when bus1 is not enabled +- ESP32 remove restart energy logging if no energy monitoring is selected - ESP32 IR receive with Arduino Core 3 [#19904](https://github.com/arendst/Tasmota/issues/19904) - ESP32-C3 ledlink functionality regression from v13.1.0.2 - Berry parser error in specific cases [#20059](https://github.com/arendst/Tasmota/issues/20059) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino index 21d2e47e1a56..66ed9b8b380d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino @@ -1379,9 +1379,6 @@ void EnergyDrvInit(void) { Energy = (tEnergy*)calloc(sizeof(tEnergy), 1); // Need calloc to reset registers to 0/false if (!Energy) { return; } - EnergySettingsLoad(0); - EnergyRtcSettingsLoad(); - Energy->value = nullptr; // Energy->voltage_common = false; // Energy->frequency_common = false; @@ -1399,9 +1396,13 @@ void EnergyDrvInit(void) { Energy->power_on = true; TasmotaGlobal.energy_driver = ENERGY_NONE; - XnrgCall(FUNC_PRE_INIT); // Find first energy driver + XnrgCall(FUNC_PRE_INIT); // Find first energy driver if (TasmotaGlobal.energy_driver) { + EnergySettingsLoad(0); + EnergyRtcSettingsLoad(); AddLog(LOG_LEVEL_INFO, PSTR("NRG: Init driver %d"), TasmotaGlobal.energy_driver); + } else { + free(Energy); // No energy driver found so release memory } }