Merge pull request #3610 from liamcottle/fix/timezone-offset
Fix: tz_offset should allow for half hour timezone offsets
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -2192,11 +2192,11 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char*
|
||||
}
|
||||
|
||||
if (strcmp(command, "get tz.offset") == 0) {
|
||||
sprintf(reply, "> %d", _prefs.tz_offset);
|
||||
sprintf(reply, "> %.1f", _prefs.tz_offset);
|
||||
return true;
|
||||
}
|
||||
if (memcmp(command, "set tz.offset ", 14) == 0) {
|
||||
int8_t tz = atof(&command[14]);
|
||||
float tz = atof(&command[14]);
|
||||
if (tz < -12 || tz > 14) {
|
||||
strcpy(reply, "Error, must be from -12 to +14");
|
||||
} else {
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
uint8_t agc_reset_interval = 0; // secs / 4
|
||||
char default_scope_name[31];
|
||||
uint8_t default_scope_key[16];
|
||||
int8_t tz_offset = 0;
|
||||
float tz_offset = 0;
|
||||
#ifdef ENABLE_WIFI_INTERFACE
|
||||
#ifndef WIFI_SSID
|
||||
#define WIFI_SSID ""
|
||||
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
#ifdef UI_SHOW_CLOCK
|
||||
display.setTextSize(3);
|
||||
uint32_t now = _rtc->getCurrentTime();
|
||||
now += (int32_t)_node_prefs->tz_offset * 3600;
|
||||
now += (int32_t)(_node_prefs->tz_offset * 3600);
|
||||
DateTime dt (now);
|
||||
sprintf(tmp, "%02d:%02d", dt.hour(), dt.minute());
|
||||
display.drawTextCentered(display.width() / 2, 60, tmp);
|
||||
|
||||
Reference in new issue
Block a user