From d0bfdaf2a90494218f43b1aff903f2fe0c5dab2e Mon Sep 17 00:00:00 2001 From: Mario Mariete <11509521+melkati@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:05:52 +0200 Subject: [PATCH] Refactor CO2_Gadget_WIFI.h return two decimals for temperature and zero for humidity in getCO2GadgetStatusAsJson() --- CO2_Gadget_WIFI.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CO2_Gadget_WIFI.h b/CO2_Gadget_WIFI.h index 508fb21c..d9dc49b2 100644 --- a/CO2_Gadget_WIFI.h +++ b/CO2_Gadget_WIFI.h @@ -759,8 +759,8 @@ String getCO2GadgetStatusAsJson() { StaticJsonDocument<512> doc; doc["mainDeviceSelected"] = mainDeviceSelected; doc["CO2"] = co2; - doc["Temperature"] = temp; - doc["Humidity"] = hum; + doc["Temperature"] = String(temp, 2); + doc["Humidity"] = String(hum, 0); doc["WiFiStatus"] = WiFi.status(); doc["SSID"] = WiFi.SSID(); #ifndef WIFI_PRIVACY