mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-05-02 14:30:57 +00:00
Fixed incorrect time diff for price fetch
This commit is contained in:
@@ -19,7 +19,7 @@ EntsoeApi::EntsoeApi(RemoteDebug* Debug) {
|
|||||||
TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60};
|
TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60};
|
||||||
tz = new Timezone(CEST, CET);
|
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) {
|
void EntsoeApi::setup(EntsoeConfig& config) {
|
||||||
@@ -64,7 +64,7 @@ float EntsoeApi::getValueForHour(time_t cur, uint8_t hour) {
|
|||||||
return ENTSOE_NO_VALUE;
|
return ENTSOE_NO_VALUE;
|
||||||
}
|
}
|
||||||
multiplier *= getCurrencyMultiplier(tomorrow->getCurrency(), config->currency);
|
multiplier *= getCurrencyMultiplier(tomorrow->getCurrency(), config->currency);
|
||||||
} else {
|
} else if(pos > 0) {
|
||||||
if(today == NULL)
|
if(today == NULL)
|
||||||
return ENTSOE_NO_VALUE;
|
return ENTSOE_NO_VALUE;
|
||||||
value = today->getPoint(pos);
|
value = today->getPoint(pos);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ private:
|
|||||||
WiFiClientSecure client;
|
WiFiClientSecure client;
|
||||||
HTTPClient https;
|
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 midnightMillis = 0;
|
||||||
uint64_t lastTodayFetch = 0;
|
uint64_t lastTodayFetch = 0;
|
||||||
uint64_t lastTomorrowFetch = 0;
|
uint64_t lastTomorrowFetch = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user