Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for users to customize certain behaviour #71

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update internal calculateWindingTime() prediction
mwood77 committed Dec 23, 2024
commit cdd5a57d05522f7b21876bdd1923ddbc8f255f01
8 changes: 4 additions & 4 deletions src/platformio/osww-server/src/main.cpp
Original file line number Diff line number Diff line change
@@ -387,9 +387,9 @@ unsigned long calculateWindingTime()

// @todo - set adjustable winding duration when coming from POST request

// We want to rest every 3 minutes for 15 seconds
long totalNumberOfRestingPeriods = totalSecondsSpentTurning / 180;
long totalRestDuration = totalNumberOfRestingPeriods * 180;
// We want to rest every userDefinedSettings.customWindDuration (180 is default) minutes for userDefinedSettings.customWindPauseDuration (5 is default) seconds
long totalNumberOfRestingPeriods = totalSecondsSpentTurning / userDefinedSettings.customWindDuration;
long totalRestDuration = totalNumberOfRestingPeriods * userDefinedSettings.customWindPauseDuration;
long finalRoutineDuration = totalRestDuration + totalSecondsSpentTurning;

Serial.print("[STATUS] - Total winding duration: ");
@@ -1470,7 +1470,7 @@ void loop()
Serial.print("[STATUS] - Pause for duration: ");
Serial.println(userDefinedSettings.customWindPauseDuration);
delay(userDefinedSettings.customWindPauseDuration);

previousEpoch = rtc.getEpoch();
}
}