Fixed #12: Time trigger activates after set time, not on
Fixed incorrect host in Maps API proxy request
This commit is contained in:
parent
bc90234f73
commit
c8bbf563f6
4576
src/assets/js.h
4576
src/assets/js.h
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,6 @@ const uint8_t VersionMetadata = 25;
|
||||
const char VersionBranch[] = "release/2.0";
|
||||
const char VersionSemVer[] = "2.0.0-beta.1";
|
||||
const char VersionFullSemVer[] = "2.0.0-beta.1+25";
|
||||
const char VersionCommitDate[] = "2018-01-19";
|
||||
const char VersionCommitDate[] = "2018-01-21";
|
||||
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@ void parseResponse()
|
||||
_dln(response);
|
||||
|
||||
char* data = response;
|
||||
if (strncmp(data, "HTTP/1.0 ", 9) != 0)
|
||||
if (strncmp(data, "HTTP/1.", 7) != 0)
|
||||
{
|
||||
_dln("Timezone :: not an HTTP response");
|
||||
return;
|
||||
@ -140,7 +140,12 @@ void updateTimezone()
|
||||
_d("Timezone :: request: ");
|
||||
_dln(request);
|
||||
|
||||
#ifdef MapsAPIViaProxyScript
|
||||
request = request + " HTTP/1.0\r\nHost: " + TimezoneProxyScriptHost + "\r\n\r\n";
|
||||
#else
|
||||
request = request + " HTTP/1.0\r\nHost: maps.googleapis.com\r\n\r\n";
|
||||
#endif
|
||||
|
||||
client->write(request.c_str());
|
||||
}, nullptr);
|
||||
|
||||
|
@ -168,7 +168,7 @@ TimeTrigger* TimeTriggerSettings::getActiveTrigger(tmElements_t &time)
|
||||
// Check if the current time is after the time set in the trigger, and
|
||||
// if this trigger is later than any previously found trigger, so that
|
||||
// we'll always get the most recent match
|
||||
if (triggerTime < dayTime && (activeTrigger == nullptr || triggerTime > activeTriggerTime))
|
||||
if (triggerTime <= dayTime && (activeTrigger == nullptr || triggerTime > activeTriggerTime))
|
||||
{
|
||||
activeTrigger = trigger;
|
||||
activeTriggerTime = triggerTime;
|
||||
|
2
web/dist/bundle.js
vendored
2
web/dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user