Skip to content

Commit

Permalink
Fix displayShowHumidity and displayShowTemperature flags not being ch…
Browse files Browse the repository at this point in the history
…ecked in showHumidityIcon and showTemperatureIcon functions
  • Loading branch information
melkati committed Apr 16, 2024
1 parent 10bfafc commit 6b9c06f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CO2_Gadget_TFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 6b9c06f

Please sign in to comment.