fix: encode OpenTherm weekdays from one to seven

This commit is contained in:
Yurii committed 2026-10-19 20:06:23 +03:00
1 parent 16308866ce
commit cd8764bb97
1 file changed
+1 -1
+1 -1
View File
@@ -1641,7 +1641,7 @@ protected:
} }
bool setTime(const struct tm *ptm) { bool setTime(const struct tm *ptm) {
const uint8_t dayOfWeek = ptm->tm_wday == 0 ? 6 : ptm->tm_wday - 1; const uint8_t dayOfWeek = ptm->tm_wday == 0 ? 7 : ptm->tm_wday;
const unsigned int request = ((dayOfWeek & 0x07) << 13) const unsigned int request = ((dayOfWeek & 0x07) << 13)
| ((ptm->tm_hour & 0x1F) << 8) | ((ptm->tm_hour & 0x1F) << 8)
| (ptm->tm_min & 0x3F); | (ptm->tm_min & 0x3F);