mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Update xsns_86_tfminiplus.ino: FIX json output (#18321)
Fixes JSON measurement output. Output numbers like Distance and SignalStrength were published as a string. Now they have the right data type.
This commit is contained in:
parent
542eca3154
commit
b1ea413eae
@ -191,7 +191,7 @@ void TfmpShow(bool json) {
|
||||
float distance = (float)tfminiplus_sensor.distance; // cm
|
||||
|
||||
if (json) {
|
||||
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_DISTANCE "\":\"%1_f\",\"" D_JSON_SIGNALSTRENGTH "\":\"%d\",\"" D_JSON_CHIPTEMPERATURE "\":%d}"),
|
||||
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_DISTANCE "\":%1_f,\"" D_JSON_SIGNALSTRENGTH "\":%d,\"" D_JSON_CHIPTEMPERATURE "\":%d}"),
|
||||
sensor_name, &distance, tfminiplus_sensor.sigstrength, tfminiplus_sensor.chiptemp);
|
||||
#ifdef USE_DOMOTICZ
|
||||
if (0 == TasmotaGlobal.tele_period) {
|
||||
@ -242,4 +242,4 @@ bool Xsns86(uint32_t callback_id)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif // USE_TFMINIPLUS
|
||||
#endif // USE_TFMINIPLUS
|
||||
|
Loading…
x
Reference in New Issue
Block a user