use timeZone from panel config

This commit is contained in:
Stephan Leuschner
2023-11-19 17:00:55 -05:00
parent 116153e77b
commit 039043fe5b
2 changed files with 2 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ nspanels:
panelRecvTopic: "tele/tasmota_nspdev2/RESULT"
panelSendTopic: "cmnd/tasmota_nspdev2/CustomSend"
timeFormat: "%H:%M"
timeZone: "Europe/Berlin"
dateFormat: "full"
locale: "en_US"
screensaver:

View File

@@ -73,7 +73,7 @@ class LovelaceUIPanel:
time.sleep(1)
def update_time(self):
use_timezone = tz.gettz("Europe/Berlin")
use_timezone = tz.gettz(self.settings["timeZone"])
time_string = datetime.datetime.now(
use_timezone).strftime(self.settings["timeFormat"])
libs.panel_cmd.send_time(self.sendTopic, time_string)