From 0fe893b01d0ab80708c1f134ff14b2b203e49830 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 27 May 2024 15:37:15 +0200 Subject: [PATCH] Fix unsupported %.2f (#21508) --- tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino | 2 +- tasmota/tasmota_xdrv_driver/xdrv_72_pipsolar.ino | 3 ++- tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino | 2 +- tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino b/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino index 035bf8869..636b904a3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_48_timeprop.ino @@ -312,7 +312,7 @@ void ShowValues(void) { ResponseAppend_P(PSTR("\"CycleTime\":%d,"),cycleTimes[i]); ResponseAppend_P(PSTR("\"DeadTime\":%d,"),deadTimes[i]); ResponseAppend_P(PSTR("\"OutputInvert\":%d,"),opInverts[i]); - ResponseAppend_P(PSTR("\"FallbackPower\":%.2f,"),fallbacks[i]); + ResponseAppend_P(PSTR("\"FallbackPower\":%2_f,"),&fallbacks[i]); ResponseAppend_P(PSTR("\"MaxUpdateInterval\":%d"),maxIntervals[i]); ResponseAppend_P(iERROR{m}Success: %u
Error: %u
CurrentError: %u
Max CurrentError: %u
ErrorRate %.2f %%{e}"), PIPSOLAR.successPoll, PIPSOLAR.errorPoll, PIPSOLAR.currentErrorPoll, PIPSOLAR.maxCurrentErrorPoll, percentError); + WSContentSend_PD(PSTR("{s}

ERROR

{m}Success: %u
Error: %u
CurrentError: %u
Max CurrentError: %u
ErrorRate %2_f %%{e}"), + PIPSOLAR.successPoll, PIPSOLAR.errorPoll, PIPSOLAR.currentErrorPoll, PIPSOLAR.maxCurrentErrorPoll, &percentError); #endif // USE_WEBSERVER } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino index b702e3d8d..924267e55 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino @@ -417,7 +417,7 @@ int MI32_decryptPacket(char * _buf, uint16_t _bufSize, uint8_t * _payload, uint3 br_ccm_run(&ctx, 0, _payload, dataLen); if(br_ccm_check_tag(&ctx, &tag)) return 0; - // AddLog(LOG_LEVEL_DEBUG,PSTR("M32: decrypted in %.2f mSec"),enctime); + // AddLog(LOG_LEVEL_DEBUG,PSTR("M32: decrypted in %2_f mSec"), &enctime); // AddLogBuffer(LOG_LEVEL_DEBUG,(uint8_t*) _payload, dataLen); if(_version == 3 && _payload[1] == 0x10) return 0; // no known way to really verify decryption, but 0x10 is expected here for button events return -1; // wrong key ... maybe corrupt data packet too diff --git a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino index 0f2f45244..0fb34e868 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino @@ -216,10 +216,10 @@ void Rg15Show(bool json) { // if the parsing wasn't completely successful then skip the update if( !isnan(Rg15.acc) && !isnan(Rg15.event) && !isnan(Rg15.total) && !isnan(Rg15.rate) ) { ResponseAppend_P(PSTR(",\"" RG15_NAME "\":{")); - ResponseAppend_P(PSTR("\"%s\":%.2f, "), D_JSON_ACTIVE, Rg15.acc); - ResponseAppend_P(PSTR("\"%s\":%.2f, "), D_JSON_EVENT, Rg15.event); - ResponseAppend_P(PSTR("\"%s\":%.2f, "), D_JSON_TOTAL, Rg15.total); - ResponseAppend_P(PSTR("\"%s\":%.2f"), D_JSON_FLOWRATE, Rg15.rate); + ResponseAppend_P(PSTR("\"%s\":%2_f,"), D_JSON_ACTIVE, &Rg15.acc); + ResponseAppend_P(PSTR("\"%s\":%2_f,"), D_JSON_EVENT, &Rg15.event); + ResponseAppend_P(PSTR("\"%s\":%2_f,"), D_JSON_TOTAL, &Rg15.total); + ResponseAppend_P(PSTR("\"%s\":%2_f"), D_JSON_FLOWRATE, &Rg15.rate); ResponseAppend_P(PSTR("}")); } #ifdef USE_WEBSERVER