From 97da53193c6a966eb9c17d8e8d6020e99adb261b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 7 Apr 2022 15:52:55 +0200 Subject: [PATCH] Fix weight_item display regression --- tasmota/xsns_34_hx711.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xsns_34_hx711.ino b/tasmota/xsns_34_hx711.ino index f25eda0ab..332c98c7e 100644 --- a/tasmota/xsns_34_hx711.ino +++ b/tasmota/xsns_34_hx711.ino @@ -260,11 +260,13 @@ bool HxCommand(void) { } if (show_parms) { + char item[33]; + dtostrfd((float)Settings->weight_item / 10, 1, item); Response_P(PSTR("{\"Sensor34\":{\"" D_JSON_WEIGHT_REF "\":%d,\"" D_JSON_WEIGHT_CAL "\":%d,\"" D_JSON_WEIGHT_MAX "\":%d,\"" - D_JSON_WEIGHT_ITEM "\":%1_f,\"" D_JSON_WEIGHT_CHANGE "\":\"%s\",\"" D_JSON_WEIGHT_DELTA "\":%d,\"" + D_JSON_WEIGHT_ITEM "\":%s,\"" D_JSON_WEIGHT_CHANGE "\":\"%s\",\"" D_JSON_WEIGHT_DELTA "\":%d,\"" D_JSON_WEIGHT_ABSC_A "\":%d,\"" D_JSON_WEIGHT_ABSC_B "\":%d}}"), Settings->weight_reference, Settings->weight_calibration, Settings->weight_max * 1000, - &Settings->weight_item, GetStateText(Settings->SensorBits1.hx711_json_weight_change), Settings->weight_change, + item, GetStateText(Settings->SensorBits1.hx711_json_weight_change), Settings->weight_change, Settings->weight_absconv_a, Settings->weight_absconv_b); }