From db223f9b039ca29fcd87d1c854c130f83262bf69 Mon Sep 17 00:00:00 2001 From: Matthias Prinke Date: Wed, 13 Nov 2024 18:34:44 +0100 Subject: [PATCH] Fixed display of invalid water temperature --- examples/Waveshare_7_5_T7_Sensors/MqttInterface.h | 2 +- examples/Waveshare_7_5_T7_Sensors/Waveshare_7_5_T7_Sensors.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Waveshare_7_5_T7_Sensors/MqttInterface.h b/examples/Waveshare_7_5_T7_Sensors/MqttInterface.h index 0c15438..73571d3 100644 --- a/examples/Waveshare_7_5_T7_Sensors/MqttInterface.h +++ b/examples/Waveshare_7_5_T7_Sensors/MqttInterface.h @@ -150,7 +150,7 @@ typedef struct MqttHistQData mqtt_hist_t; //!< Shortcut for struct MqttHistQData #define INV_UINT32 0xFFFFFFFF #define INV_UINT16 0xFFFF #define INV_UINT8 0xFF -#define INV_TEMP 327.67 +#define INV_TEMP 327.67f class MqttInterface { diff --git a/examples/Waveshare_7_5_T7_Sensors/Waveshare_7_5_T7_Sensors.ino b/examples/Waveshare_7_5_T7_Sensors/Waveshare_7_5_T7_Sensors.ino index 83a03e8..74859f1 100644 --- a/examples/Waveshare_7_5_T7_Sensors/Waveshare_7_5_T7_Sensors.ino +++ b/examples/Waveshare_7_5_T7_Sensors/Waveshare_7_5_T7_Sensors.ino @@ -902,7 +902,7 @@ void DisplayMQTTWeather(const unsigned char *status_bitmap) #if defined(WATERTEMP_EN) // Water Temperature Sensor - if (MqttSensors.water_temp_c != WATER_TEMP_INVALID || MqttHistTStamp == 0) + if ((MqttSensors.water_temp_c != WATER_TEMP_INVALID) && (MqttSensors.water_temp_c < INV_TEMP - 1)) { DisplayLocalTemperatureSection(358, 187, 137, 100, "", true, MqttSensors.water_temp_c, false, 0, 0); u8g2Fonts.setFont(u8g2_font_helvB18_tf);