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

@kaerbr kaerbr force-pushed the granular-and-generic-scheduling branch from 7fa439c to e5d825b Compare November 9, 2025 13:00
@kaerbr kaerbr force-pushed the granular-and-generic-scheduling branch from e5d825b to a732d60 Compare November 19, 2025 06:30
@kaerbr kaerbr force-pushed the granular-and-generic-scheduling branch from a732d60 to a6d14cc Compare November 19, 2025 06:33
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