From e06be184327b7b3bc2c5d9c0470591228299ad30 Mon Sep 17 00:00:00 2001 From: biver Date: Tue, 1 Feb 2022 23:00:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D1=80=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=20=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D1=81=D0=BE=D0=B1=D1=8B?= =?UTF-8?q?=D1=82=D0=B8=D0=B5,=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D0=B0=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B2=20Sht20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/Sht20.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/Sht20.cpp b/src/modules/Sht20.cpp index 3685df20..e53994ff 100644 --- a/src/modules/Sht20.cpp +++ b/src/modules/Sht20.cpp @@ -14,7 +14,8 @@ class Sht20t : public IoTSensor { void doByInterval() { sht->read(); float value = sht->getTemperature(); - regEvent((String)value, "Sht20t"); + if (value != -46.85) regEvent(value, "Sht20t"); + else SerialPrint("E", "Sensor Sht20t", "Error"); } ~Sht20t(); @@ -27,8 +28,9 @@ class Sht20h : public IoTSensor { void doByInterval() { sht->read(); float value = sht->getHumidity(); - regEvent((String)value, "Sht20h"); - } + if (value != -6) regEvent(value, "Sht20h"); + else SerialPrint("E", "Sensor Sht20h", "Error"); + } ~Sht20h(); };