From a439ef9f0edf4928fa4ef3ea70acfeeb30ad4efe Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 11 Jul 2019 10:56:12 +0200 Subject: [PATCH] Workaround invalid detection of SHT3x sensors Workaround invalid detection of SHT3x sensors (#6067) --- sonoff/xsns_14_sht3x.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xsns_14_sht3x.ino b/sonoff/xsns_14_sht3x.ino index 36f39fe7b..2eb3317de 100755 --- a/sonoff/xsns_14_sht3x.ino +++ b/sonoff/xsns_14_sht3x.ino @@ -71,7 +71,7 @@ bool Sht3xRead(float &t, float &h, uint8_t sht3x_address) }; t = ConvertTemp((float)((((data[0] << 8) | data[1]) * 175) / 65535.0) - 45); h = ConvertHumidity((float)((((data[3] << 8) | data[4]) * 100) / 65535.0)); // Set global humidity - return (!isnan(t) && !isnan(h)); + return (!isnan(t) && !isnan(h) && (h != 0)); } /********************************************************************************************/