From 7107d640a5ea5eee1da6b4ef9e963ee30c4c95c9 Mon Sep 17 00:00:00 2001 From: v00g100skr Date: Mon, 12 Jun 2023 12:42:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BA=D1=80=D0=B0=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8F=20=D0=BF=D1=80=D0=BE=D1=88=D0=B8=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8:=20=20-=20=D1=84=D1=96=D0=BA=D1=81=20=D1=96=D0=BD=D0=B4?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D1=86=D1=96=D0=B9=20=D0=BD=D0=BE=D0=B2=D0=B8?= =?UTF-8?q?=D1=85=20=D1=82=D1=80=D0=B8=D0=B2=D0=BE=D0=B3=20=D1=96=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BD=D0=B5=D0=BD=D0=BD=D1=8F=20=D0=B2?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=20=D0=B1=D0=B5=D0=B7=20=D1=82?= =?UTF-8?q?=D1=80=D0=B8=D0=B2=D0=BE=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/firmware.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/firmware.h b/src/firmware.h index f326e8f1..54bda332 100644 --- a/src/firmware.h +++ b/src/firmware.h @@ -212,7 +212,7 @@ WiFiUDP ntpUDP; HTTPClient http; NTPClient timeClient(ntpUDP, "ua.pool.ntp.org", 7200); -int alarmsPeriod = 30000; +int alarmsPeriod = 15000; int weatherPeriod = 600000; unsigned long lastAlarmsTime; unsigned long lastWeatherTime; @@ -643,26 +643,19 @@ void alamsUpdate() { for (int i = 0; i < NUM_LEDS; i++) { enable = doc["states"][states[i]]["enabled"].as(); if (enable) { - if (times[i] == 0) { + if (times[i] == 0 || (ledColor[i] == 3 || ledColor[i] == 4)) { times[i] = t; - ledColor[i] = 2; - alarmsNowCount++; } if (times[i] + newAlarmPeriod > t){ ledColor[i] = 2; - alarmsNowCount++; } if (times[i] + newAlarmPeriod <= t){ ledColor[i] = 1; - alarmsNowCount++; } + alarmsNowCount++; } else { - if (times[i] == 0) { + if (times[i] == 0 || (ledColor[i] == 1 || ledColor[i] == 2)) { times[i] = t; - ledColor[i] = 4; - } - if (times[i] + newAlarmPeriod > t && (ledColor[i] == 1 || ledColor[i] == 2)){ - ledColor[i] = 4; } if (times[i] + newAlarmPeriod > t){ ledColor[i] = 4;