Skip to content

Conversation

@kaerbr
Copy link

@kaerbr kaerbr commented Jul 6, 2025

As I already told in the issue #162 I came up with a solution for my problem.
If you think this is ready for merging I would be happy.

Explanation:
I've replaced

const int SLEEP_DURATION = 30; // minutes
const int BED_TIME  = 00; // Last update at 00:00 (midnight) until WAKE_TIME.
const int WAKE_TIME = 06; // Hour of first update after BED_TIME, 06:00.

By:

ScheduleSegment scheduleSegments[] = {
  {MONDAY | WEDNESDAY | FRIDAY, "07:00", "22:00", 90},
  {TUESDAY | THURSDAY, "07:00", "09:00", 60},
  {TUESDAY | THURSDAY, "16:30", "22:00", 90},
  {SATURDAY | SUNDAY, "08:00", "23:00", 90}
};

This struct ScheduleSegment contains a list of:
{<Weekdays>, <Starttime>, <EndTime>, <Interval>}

The example mentioned above translates into english like this:

  • Monday, Wednesday, Friday:
    • 07:00 to 22:00 every 90 minutes
  • Tuesday, Thursday:
    • 07:00-09:00 every 60 minutes
    • 16:30-22:00 every 90 minutes
  • Saturday, Sunday
    • 08:00-23:00 every 90 minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant