финальная версия с сенсором

This commit is contained in:
Dmitry Borisenko
2021-12-14 23:55:17 +01:00
parent 1529da443b
commit b68fa1b0f6
6 changed files with 37 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ SensorAny::~SensorAny() {}
void SensorAny::loop() {
difference = millis() - prevMillis;
if (difference >= _interval) {
if (difference >= _interval * 1000) {
prevMillis = millis();
read();
}
@@ -54,6 +54,7 @@ void AnySensor() {
jsonWriteStr(params, "addr", myLineParsing.gaddr());
jsonWriteStr(params, "int", myLineParsing.gint());
jsonWriteStr(params, "c", myLineParsing.gc());
jsonWriteStr(params, "type", myLineParsing.gtype());
myLineParsing.clear();
static bool firstTime = true;