mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
use timeZone from panel config
This commit is contained in:
@@ -4,6 +4,7 @@ nspanels:
|
|||||||
panelRecvTopic: "tele/tasmota_nspdev2/RESULT"
|
panelRecvTopic: "tele/tasmota_nspdev2/RESULT"
|
||||||
panelSendTopic: "cmnd/tasmota_nspdev2/CustomSend"
|
panelSendTopic: "cmnd/tasmota_nspdev2/CustomSend"
|
||||||
timeFormat: "%H:%M"
|
timeFormat: "%H:%M"
|
||||||
|
timeZone: "Europe/Berlin"
|
||||||
dateFormat: "full"
|
dateFormat: "full"
|
||||||
locale: "en_US"
|
locale: "en_US"
|
||||||
screensaver:
|
screensaver:
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class LovelaceUIPanel:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
def update_time(self):
|
def update_time(self):
|
||||||
use_timezone = tz.gettz("Europe/Berlin")
|
use_timezone = tz.gettz(self.settings["timeZone"])
|
||||||
time_string = datetime.datetime.now(
|
time_string = datetime.datetime.now(
|
||||||
use_timezone).strftime(self.settings["timeFormat"])
|
use_timezone).strftime(self.settings["timeFormat"])
|
||||||
libs.panel_cmd.send_time(self.sendTopic, time_string)
|
libs.panel_cmd.send_time(self.sendTopic, time_string)
|
||||||
|
|||||||
Reference in New Issue
Block a user