mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 23:45:25 +00:00
Fixed incorrect time diff for price fetch
This commit is contained in:
parent
4b51f0f235
commit
04daf551fb
@ -19,7 +19,7 @@ EntsoeApi::EntsoeApi(RemoteDebug* Debug) {
|
||||
TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60};
|
||||
tz = new Timezone(CEST, CET);
|
||||
|
||||
tomorrowFetchMillis = random(3600000,3780000); // Random between 13:30 and 14:00
|
||||
tomorrowFetchMillis = 36000000 + (random(1800) * 1000); // Random between 13:30 and 14:00
|
||||
}
|
||||
|
||||
void EntsoeApi::setup(EntsoeConfig& config) {
|
||||
@ -64,7 +64,7 @@ float EntsoeApi::getValueForHour(time_t cur, uint8_t hour) {
|
||||
return ENTSOE_NO_VALUE;
|
||||
}
|
||||
multiplier *= getCurrencyMultiplier(tomorrow->getCurrency(), config->currency);
|
||||
} else {
|
||||
} else if(pos > 0) {
|
||||
if(today == NULL)
|
||||
return ENTSOE_NO_VALUE;
|
||||
value = today->getPoint(pos);
|
||||
|
||||
@ -35,7 +35,7 @@ private:
|
||||
WiFiClientSecure client;
|
||||
HTTPClient https;
|
||||
|
||||
uint32_t tomorrowFetchMillis = 3600000; // Number of ms before midnight. Default fetch 10hrs before midnight (14:00 CE(S)T)
|
||||
uint32_t tomorrowFetchMillis = 36000000; // Number of ms before midnight. Default fetch 10hrs before midnight (14:00 CE(S)T)
|
||||
uint64_t midnightMillis = 0;
|
||||
uint64_t lastTodayFetch = 0;
|
||||
uint64_t lastTomorrowFetch = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user