From 8b8deded9a8edb7abb2279d1b8d70b61444333b0 Mon Sep 17 00:00:00 2001 From: lumapu Date: Sat, 22 Oct 2022 01:29:29 +0200 Subject: [PATCH] improvements by @homeautomation22 --- tools/esp8266/app.cpp | 2 +- tools/esp8266/hmDefines.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/esp8266/app.cpp b/tools/esp8266/app.cpp index bc9e00ee..7dae17ec 100644 --- a/tools/esp8266/app.cpp +++ b/tools/esp8266/app.cpp @@ -154,7 +154,7 @@ void app::loop(void) { mMqtt.loop(); if(checkTicker(&mTicker, 1000)) { - if(mUtcTimestamp > 946684800 && mConfig.sunLat && mConfig.sunLon && (mUtcTimestamp + mCalculatedTimezoneOffset) / 86400 > (mLatestSunTimestamp + mCalculatedTimezoneOffset) / 86400) { // update on reboot or midnight + if(mUtcTimestamp > 946684800 && mConfig.sunLat && mConfig.sunLon && (mUtcTimestamp + mCalculatedTimezoneOffset) / 86400 != (mLatestSunTimestamp + mCalculatedTimezoneOffset) / 86400) { // update on reboot or midnight if (!mLatestSunTimestamp) { // first call: calculate time zone from longitude to refresh at local midnight mCalculatedTimezoneOffset = (int8_t)((mConfig.sunLon >= 0 ? mConfig.sunLon + 7.5 : mConfig.sunLon - 7.5) / 15) * 3600; } diff --git a/tools/esp8266/hmDefines.h b/tools/esp8266/hmDefines.h index 465a2421..b89dd9a4 100644 --- a/tools/esp8266/hmDefines.h +++ b/tools/esp8266/hmDefines.h @@ -106,7 +106,7 @@ const byteAssign_t SystemConfigParaAssignment[] = { { FLD_ACT_PF, UNIT_NONE, CH0, 6, 2, 1000 }*/ }; #define HMSYSTEM_LIST_LEN (sizeof(SystemConfigParaAssignment) / sizeof(byteAssign_t)) -#define HMSYSTEM_PAYLOAD_LEN 0 // 0: means check is off +#define HMSYSTEM_PAYLOAD_LEN 14 const byteAssign_t AlarmDataAssignment[] = { { FLD_LAST_ALARM_CODE, UNIT_NONE, CH0, 0, 2, 1 }