mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
companion: get/set timezone offset for clock
* Add tz_offset companion prefs and get/set commands for companion cli * Use tz_offset for clock on display Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>
This commit is contained in:
@@ -7,10 +7,6 @@
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
|
||||
#ifndef UI_TZ_OFFSET
|
||||
#define UI_TZ_OFFSET 0
|
||||
#endif
|
||||
|
||||
#ifndef AUTO_OFF_MILLIS
|
||||
#define AUTO_OFF_MILLIS 15000 // 15 seconds
|
||||
#endif
|
||||
@@ -256,8 +252,7 @@ public:
|
||||
#ifdef UI_SHOW_CLOCK
|
||||
display.setTextSize(3);
|
||||
uint32_t now = _rtc->getCurrentTime();
|
||||
int8_t tz = UI_TZ_OFFSET; // for now draw time from Santo Domingo ...
|
||||
now += (int32_t)tz * 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