Fixed what hours the fixed price is applied to

This commit is contained in:
Gunnar Skjold 2025-11-27 09:34:20 +01:00
parent 1cf890dc26
commit a986e7b1c3

View File

@ -242,9 +242,10 @@ float PriceService::getFixedPrice(uint8_t direction, int8_t hour) {
tmElements_t tm;
breakTime(tz->toLocal(ts), tm);
tm.Hour = hour;
tm.Minute = 0;
tm.Second = 0;
breakTime(makeTime(tm) + (hour * SECS_PER_HOUR), tm);
breakTime(makeTime(tm), tm);
float value = PRICE_NO_VALUE;
for (uint8_t i = 0; i < priceConfig.size(); i++) {