fixing logic error after 5 min

This commit is contained in:
Robert van den Breemen 2022-05-28 10:29:55 +02:00
parent 091868bce4
commit c145f64fc1
4 changed files with 20 additions and 11 deletions

View File

@ -94,6 +94,7 @@ bool bOTGWboilerstate = false;
bool bOTGWthermostatstate = false;
bool bOTGWgatewaystate = false;
bool bPrintSummarymode = false; //default to PS=0 mode
bool bCheckOTGWPICupdate = false;
//All things that are settings
String settingHostname = _HOSTNAME;

View File

@ -245,6 +245,15 @@ void do5minevent(){
sendMQTTuptime();
sendMQTTversioninfo();
sendMQTTstateinformation();
if (bCheckOTGWPICupdate) {
bCheckOTGWPICupdate = false;
checkOTWGpicforupdate();
}
}
//===[ Do task every 24 hours ]===
void doTaskEvery24h(){
bCheckOTGWPICupdate = true;
}
//===[ Do the background tasks ]===
@ -270,8 +279,7 @@ void loop()
DECLARE_TIMER_SEC(timer30s, 30, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_SEC(timer60s, 60, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(timer5min, 5, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(timer5mincheck, 5, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(tmrcheckpic, 1440, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(timer24h, 1440, CATCH_UP_MISSED_TICKS);
if (DUE(timerpollsensor)) pollSensors(); // poll the temperature sensors connected to 2wire gpio pin
if (DUE(timer5min)) do5minevent();
@ -279,8 +287,7 @@ void loop()
if (DUE(timer30s)) doTaskEvery30s();
if (DUE(timer5s)) doTaskEvery5s();
if (DUE(timer1s)) doTaskEvery1s();
if (DUE(tmrcheckpic)) checkOTWGpicforupdate(); //every 24 hours
if (TIME_LEFT(timer5mincheck)==0) checkOTWGpicforupdate(); //5 minutes after reboot
if (DUE(timer24h)) doTaskEvery24h();
evalOutputs(); // when the bits change, the output gpio bit will follow
doBackgroundTasks();
}

View File

@ -741,6 +741,7 @@
,[ "author", "Developer"]
,[ "fwversion", "ESP8266 Firmware Version"]
,[ "picfwversion", "OTGW PIC Firmware Version"]
,[ "picdeviceid", "OTGW PIC Device ID"]
,[ "compiled", "Compiled on (date/time)"]
,[ "HostName", "Hostname (add .local)"]
,[ "ipaddress", "IP address"]

View File

@ -2,15 +2,15 @@
#define _VERSION_MAJOR 0
#define _VERSION_MINOR 9
#define _VERSION_PATCH 5
#define _VERSION_BUILD 1681
#define _VERSION_GITHASH "9977fea"
#define _VERSION_BUILD 1684
#define _VERSION_GITHASH "091868b"
//#define _VERSION_PRERELEASE beta //uncomment to define prerelease labels: alpha - beta - rc
#define _VERSION_DATE "28-05-2022"
#define _VERSION_TIME "09:09:51"
#define _VERSION_TIME "10:29:38"
#define _SEMVER_CORE "0.9.5"
#define _SEMVER_BUILD "0.9.5+1681"
#define _SEMVER_GITHASH "0.9.5+9977fea"
#define _SEMVER_FULL "0.9.5+9977fea"
#define _SEMVER_BUILD "0.9.5+1684"
#define _SEMVER_GITHASH "0.9.5+091868b"
#define _SEMVER_FULL "0.9.5+091868b"
#define _SEMVER_NOBUILD "0.9.5 (28-05-2022)"
#define _VERSION "0.9.5+9977fea (28-05-2022)"
#define _VERSION "0.9.5+091868b (28-05-2022)"
//The version information is created automatically, more information here: https://github.com/rvdbreemen/autoinc-semver