mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 06:27:01 +01:00
use timeZone from panel config
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user