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_IPV6
|
||||||
#endif // USE_ETHERNET
|
#endif // USE_ETHERNET
|
||||||
ResponseAppend_P(PSTR(",\"" D_CMND_WEBSERVER "\":%d,\"HTTP_API\":%d,\"" D_CMND_WIFICONFIG "\":%d,\"" D_CMND_WIFIPOWER "\":%s}}"),
|
float wifi_tx_power = WifiGetOutputPower();
|
||||||
Settings->webserver, Settings->flag5.disable_referer_chk, Settings->sta_config, WifiGetOutputPower().c_str());
|
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);
|
CmndStatusResponse(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2535,7 +2536,7 @@ void CmndWifiPower(void) {
|
||||||
}
|
}
|
||||||
WifiSetOutputPower();
|
WifiSetOutputPower();
|
||||||
}
|
}
|
||||||
ResponseCmndChar(WifiGetOutputPower().c_str());
|
ResponseCmndFloat(WifiGetOutputPower(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CmndWifi(void)
|
void CmndWifi(void)
|
||||||
|
|
|
@ -974,14 +974,11 @@ int WifiState(void)
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
String WifiGetOutputPower(void) {
|
float WifiGetOutputPower(void) {
|
||||||
char stemp1[TOPSZ];
|
|
||||||
if (Settings->wifi_output_power) {
|
if (Settings->wifi_output_power) {
|
||||||
dtostrfd((float)(Settings->wifi_output_power) / 10, 1, stemp1);
|
Wifi.last_tx_pwr = Settings->wifi_output_power;
|
||||||
} else {
|
|
||||||
dtostrfd((float)(Wifi.last_tx_pwr) / 10, 0, stemp1); // No decimal to indicate dynamic tx power
|
|
||||||
}
|
}
|
||||||
return String(stemp1);
|
return (float)(Wifi.last_tx_pwr) / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WifiSetOutputPower(void) {
|
void WifiSetOutputPower(void) {
|
||||||
|
|
Loading…
Reference in New Issue