mirror of https://github.com/arendst/Tasmota.git
Fix correct JSON display of WifiPower float
This commit is contained in:
parent
f3cc8997b0
commit
f5d6578fb5
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue