mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-08 22:36:33 +01:00
add timeAdditonalTemplate
This commit is contained in:
@@ -81,6 +81,7 @@ class LuiBackendConfig(object):
|
||||
'timeFormat': "%H:%M",
|
||||
'dateFormatBabel': "full",
|
||||
'dateAdditonalTemplate': "",
|
||||
'timeAdditonalTemplate': "",
|
||||
'dateFormat': "%A, %d. %B %Y",
|
||||
'cards': [{
|
||||
'type': 'cardEntities',
|
||||
|
||||
@@ -42,7 +42,9 @@ class LuiPagesGen(object):
|
||||
|
||||
def update_time(self, kwargs):
|
||||
time = datetime.datetime.now().strftime(self._config.get("timeFormat"))
|
||||
self._send_mqtt_msg(f"time~{time}")
|
||||
addTemplate = self._config.get("timeAdditonalTemplate")
|
||||
addTimeText = self._ha_api.render_template(addTemplate)
|
||||
self._send_mqtt_msg(f"time~{time}~{addTimeText}")
|
||||
|
||||
def update_date(self, kwargs):
|
||||
global babel_spec
|
||||
|
||||
Reference in New Issue
Block a user