mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 08:26:38 +02:00
improvements by @homeautomation22
This commit is contained in:
parent
a77bea55d0
commit
8b8deded9a
2 changed files with 2 additions and 2 deletions
|
@ -154,7 +154,7 @@ void app::loop(void) {
|
||||||
mMqtt.loop();
|
mMqtt.loop();
|
||||||
|
|
||||||
if(checkTicker(&mTicker, 1000)) {
|
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
|
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;
|
mCalculatedTimezoneOffset = (int8_t)((mConfig.sunLon >= 0 ? mConfig.sunLon + 7.5 : mConfig.sunLon - 7.5) / 15) * 3600;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ const byteAssign_t SystemConfigParaAssignment[] = {
|
||||||
{ FLD_ACT_PF, UNIT_NONE, CH0, 6, 2, 1000 }*/
|
{ FLD_ACT_PF, UNIT_NONE, CH0, 6, 2, 1000 }*/
|
||||||
};
|
};
|
||||||
#define HMSYSTEM_LIST_LEN (sizeof(SystemConfigParaAssignment) / sizeof(byteAssign_t))
|
#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[] = {
|
const byteAssign_t AlarmDataAssignment[] = {
|
||||||
{ FLD_LAST_ALARM_CODE, UNIT_NONE, CH0, 0, 2, 1 }
|
{ FLD_LAST_ALARM_CODE, UNIT_NONE, CH0, 0, 2, 1 }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue