From b22860315859836680732dbe0c4126895ad40534 Mon Sep 17 00:00:00 2001 From: Mit4el Date: Tue, 12 Mar 2024 00:16:09 +0300 Subject: [PATCH] =?UTF-8?q?fix=20NTP=202902=20=D0=B8=20=D0=BC=D0=B5=D0=BB?= =?UTF-8?q?=D0=BA=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- myProfile.json | 6 +++++- src/NTP.cpp | 9 +++++++++ src/modules/exec/SmartBoiler/SmartBoiler.cpp | 5 +++-- src/modules/virtual/Benchmark/modinfo.json | 16 ++-------------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/myProfile.json b/myProfile.json index 2b96cb10..e3875499 100644 --- a/myProfile.json +++ b/myProfile.json @@ -156,6 +156,10 @@ "path": "src/modules/virtual/owmWeather", "active": true }, + { + "path": "src/modules/virtual/Ping", + "active": true + }, { "path": "src/modules/virtual/Timer", "active": true @@ -294,7 +298,7 @@ "path": "src/modules/sensors/Mhz19", "active": false }, - { + { "path": "src/modules/sensors/MQgas", "active": true }, diff --git a/src/NTP.cpp b/src/NTP.cpp index 6d4a44e1..f43654ce 100644 --- a/src/NTP.cpp +++ b/src/NTP.cpp @@ -167,6 +167,15 @@ unsigned long strDateToUnix(String date) { int numberOfLeepYears = 12; int totalNormalYears = year - 1970 - numberOfLeepYears; unsigned int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + if (year % 4 == 0) { + if (year % 100 != 0 || year % 400 == 0) { + daysInMonth[1] = 29; + } else { + daysInMonth[1] = 28; + } + } else { + daysInMonth[1] = 28; + } int numberOfDaysInPastMonths = 0; for (int i = 0; i <= 11; i++) { if (i <= month - 2) { diff --git a/src/modules/exec/SmartBoiler/SmartBoiler.cpp b/src/modules/exec/SmartBoiler/SmartBoiler.cpp index cd18db2d..e2821d5a 100644 --- a/src/modules/exec/SmartBoiler/SmartBoiler.cpp +++ b/src/modules/exec/SmartBoiler/SmartBoiler.cpp @@ -56,7 +56,8 @@ namespace _Boiler_v2 tmp = findIoTItem(widget); if (tmp) { - tmp->setValue(value, true); + if (value != tmp->value.valS) + tmp->setValue(value, true); } else { @@ -902,7 +903,7 @@ namespace _Boiler_v2 //} if (!state.stateDHW) // Если уже включено ГВС, то нечего смотреть на отопление { - if (set.cmd_chEnable && stepMap.size()>0) + if (set.cmd_chEnable && stepMap.size() > 0) { SerialPrint("I", "SmartBoiler", " stepMap.size = " + String(stepMap.size())); publishNew("status", "Штатный режим"); diff --git a/src/modules/virtual/Benchmark/modinfo.json b/src/modules/virtual/Benchmark/modinfo.json index d33a869c..538a62b6 100644 --- a/src/modules/virtual/Benchmark/modinfo.json +++ b/src/modules/virtual/Benchmark/modinfo.json @@ -51,19 +51,7 @@ "defActive": false, "usedLibs": { - "esp32_4mb": [], - "esp32_4mb3f": [], - "esp32s2_4mb": [], - "esp32_16mb": [], - "esp32s3_16mb": [], - "esp32c3m_4mb": [], - "esp8266_4mb": [], - "esp8266_16mb": [], - "esp8266_1mb": [], - "esp8266_1mb_ota": [], - "esp8285_1mb": [], - "esp8285_1mb_ota": [], - "esp8266_2mb": [], - "esp8266_2mb_ota": [] + "esp32*": [], + "esp82*": [] } }