Fixed MQTT and WS Routing - w/o SSL

This commit is contained in:
2025-10-13 17:34:54 +03:00
parent f696984cd1
commit 956786321a
29 changed files with 2043 additions and 1210 deletions

View File

@@ -267,9 +267,13 @@ void Timekeeper::checkAndSyncPhysicalClock() {
// Calculate time difference (your exact logic!)
int16_t timeDifference = (realHour * 60 + realMinute) - (physicalHour * 60 + physicalMinute);
LOG_VERBOSE("⏰ CHECK: Real time %02d:%02d vs Physical %02d:%02d - DIFF: %d mins",
realHour, realMinute, physicalHour, physicalMinute, timeDifference);
// Handle 12-hour rollover (if negative, add 12 hours)
if (timeDifference < 0) {
timeDifference += 12 * 60; // Add 12 hours to handle rollover
LOG_VERBOSE("⏰ DIFF: Adjusted for rollover, new difference %d minutes", timeDifference);
}
// If there's a difference, advance the clock by one minute (your runMotor equivalent)
@@ -310,7 +314,7 @@ void Timekeeper::updatePhysicalClockTime() {
currentMinute = 0;
currentHour++;
if (currentHour > 12) { // 12-hour clock (your code used 24, but clock face is 12)
currentHour = 0;
currentHour = 1;
}
}