diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 14ce3d846..b4661c896 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -883,8 +883,9 @@ void CmndStatus(void) #endif // USE_IPV6 #endif // USE_ETHERNET - ResponseAppend_P(PSTR(",\"" D_CMND_WEBSERVER "\":%d,\"HTTP_API\":%d,\"" D_CMND_WIFICONFIG "\":%d,\"" D_CMND_WIFIPOWER "\":%s}}"), - Settings->webserver, Settings->flag5.disable_referer_chk, Settings->sta_config, WifiGetOutputPower().c_str()); + float wifi_tx_power = WifiGetOutputPower(); + ResponseAppend_P(PSTR(",\"" D_CMND_WEBSERVER "\":%d,\"HTTP_API\":%d,\"" D_CMND_WIFICONFIG "\":%d,\"" D_CMND_WIFIPOWER "\":%1_f}}"), + Settings->webserver, Settings->flag5.disable_referer_chk, Settings->sta_config, &wifi_tx_power); CmndStatusResponse(5); } @@ -2535,7 +2536,7 @@ void CmndWifiPower(void) { } WifiSetOutputPower(); } - ResponseCmndChar(WifiGetOutputPower().c_str()); + ResponseCmndFloat(WifiGetOutputPower(), 1); } void CmndWifi(void) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index c518af1d2..cb701a304 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -974,14 +974,11 @@ int WifiState(void) return state; } -String WifiGetOutputPower(void) { - char stemp1[TOPSZ]; +float WifiGetOutputPower(void) { if (Settings->wifi_output_power) { - dtostrfd((float)(Settings->wifi_output_power) / 10, 1, stemp1); - } else { - dtostrfd((float)(Wifi.last_tx_pwr) / 10, 0, stemp1); // No decimal to indicate dynamic tx power + Wifi.last_tx_pwr = Settings->wifi_output_power; } - return String(stemp1); + return (float)(Wifi.last_tx_pwr) / 10; } void WifiSetOutputPower(void) {