From 6b9c06f3fc60c6cc783deb00bc350a6b4f48860a Mon Sep 17 00:00:00 2001 From: Mario Mariete <11509521+melkati@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:30:49 +0200 Subject: [PATCH] Fix displayShowHumidity and displayShowTemperature flags not being checked in showHumidityIcon and showTemperatureIcon functions --- CO2_Gadget_TFT.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CO2_Gadget_TFT.h b/CO2_Gadget_TFT.h index 166469e7..c5d06f72 100644 --- a/CO2_Gadget_TFT.h +++ b/CO2_Gadget_TFT.h @@ -500,6 +500,7 @@ void showEspNowIcon(int32_t posX, int32_t posY, bool forceRedraw) { } void showTemperatureIcon(int32_t posX, int32_t posY, bool forceRedraw) { + if (!displayShowTemperature) return; tft.setSwapBytes(true); tft.pushImage(posX, posY, 16, 16, iconTemperature); } @@ -519,7 +520,7 @@ uint16_t getTemperatureColor(float temp) { void showTemperature(float temp, int32_t posX, int32_t posY, bool forceRedraw) { if (!displayShowTemperature) return; showTemperatureIcon(posX, posY, forceRedraw); - String temperatureString = (showFahrenheit ? String(tempFahrenheit, 1) : String(temp, 1)) + "° "; + String temperatureString = (showFahrenheit ? String(tempFahrenheit, 1) + "°F" : String(temp, 1)) + "°C"; tft.setCursor(posX + 18, posY); spr.loadFont(SMALL_FONT); spr.setTextColor(getTemperatureColor(temp), TFT_BLACK); @@ -528,6 +529,7 @@ void showTemperature(float temp, int32_t posX, int32_t posY, bool forceRedraw) { } void showHumidityIcon(int32_t posX, int32_t posY, bool forceRedraw) { + if (!displayShowHumidity) return; tft.setSwapBytes(true); tft.pushImage(posX, posY, 16, 16, iconHumidity); }