mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 11:59:12 +03:00
Запрещаем регистрировать событие, если ошибка чтения в Sht20
This commit is contained in:
@@ -14,7 +14,8 @@ class Sht20t : public IoTSensor {
|
|||||||
void doByInterval() {
|
void doByInterval() {
|
||||||
sht->read();
|
sht->read();
|
||||||
float value = sht->getTemperature();
|
float value = sht->getTemperature();
|
||||||
regEvent((String)value, "Sht20t");
|
if (value != -46.85) regEvent(value, "Sht20t");
|
||||||
|
else SerialPrint("E", "Sensor Sht20t", "Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
~Sht20t();
|
~Sht20t();
|
||||||
@@ -27,8 +28,9 @@ class Sht20h : public IoTSensor {
|
|||||||
void doByInterval() {
|
void doByInterval() {
|
||||||
sht->read();
|
sht->read();
|
||||||
float value = sht->getHumidity();
|
float value = sht->getHumidity();
|
||||||
regEvent((String)value, "Sht20h");
|
if (value != -6) regEvent(value, "Sht20h");
|
||||||
}
|
else SerialPrint("E", "Sensor Sht20h", "Error");
|
||||||
|
}
|
||||||
|
|
||||||
~Sht20h();
|
~Sht20h();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user