mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-08 13:41:40 +02:00
0.8.41
* fix display timeout (OLED) to 60s * change offs to signed value
This commit is contained in:
parent
3dd4997094
commit
f2e1e536f5
8 changed files with 18 additions and 14 deletions
|
@ -235,7 +235,7 @@ void app::tickCalcSunrise(void) {
|
|||
onceAt(std::bind(&app::tickCalcSunrise, this), nxtTrig, "Sunri");
|
||||
if (mMqttEnabled) {
|
||||
tickSun();
|
||||
nxtTrig = mSunrise - mConfig->sun.offsetSecMorning + 1; // one second safety to trigger correctly
|
||||
nxtTrig = mSunrise + mConfig->sun.offsetSecMorning + 1; // one second safety to trigger correctly
|
||||
onceAt(std::bind(&app::tickSun, this), nxtTrig, "mqSr"); // trigger on sunrise to update 'dis_night_comm'
|
||||
}
|
||||
}
|
||||
|
@ -254,8 +254,8 @@ void app::tickIVCommunication(void) {
|
|||
|
||||
iv->commEnabled = !iv->config->disNightCom; // if sun.disNightCom is false, communication is always on
|
||||
if (!iv->commEnabled) { // inverter communication only during the day
|
||||
if (mTimestamp < (mSunrise - mConfig->sun.offsetSecMorning)) { // current time is before communication start, set next trigger to communication start
|
||||
nxtTrig = mSunrise - mConfig->sun.offsetSecMorning;
|
||||
if (mTimestamp < (mSunrise + mConfig->sun.offsetSecMorning)) { // current time is before communication start, set next trigger to communication start
|
||||
nxtTrig = mSunrise + mConfig->sun.offsetSecMorning;
|
||||
} else {
|
||||
if (mTimestamp >= (mSunset + mConfig->sun.offsetSecEvening)) { // current time is past communication stop, nothing to do. Next update will be done at midnight by tickCalcSunrise
|
||||
nxtTrig = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue