mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 14:14:12 +01:00
added auto update to config examples
This commit is contained in:
@@ -250,7 +250,8 @@ nspanel-1:
|
||||
config:
|
||||
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
|
||||
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
|
||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
||||
updateMode: auto-notify # possible values are auto, auto-notify and manual
|
||||
timeoutScreensaver: 15 #in seconds
|
||||
#brightnessScreensaver: 10
|
||||
brightnessScreensaver:
|
||||
- time: "7:00:00"
|
||||
|
||||
@@ -5,7 +5,8 @@ nspanel:
|
||||
config:
|
||||
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
|
||||
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
|
||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
||||
updateMode: auto-notify # possible values are auto, auto-notify and manual
|
||||
timeoutScreensaver: 15 #in seconds
|
||||
#brightnessScreensaver: 10
|
||||
brightnessScreensaver:
|
||||
- time: "7:00:00"
|
||||
|
||||
@@ -77,6 +77,7 @@ class Updater:
|
||||
self.nsplui.mqtt.mqtt_publish(self.nsplui.config["panelSendTopic"].replace("CustomSend", "UpdateDriverVersion"), self.desired_tasmota_driver_url)
|
||||
def update_panel_driver(self):
|
||||
self.nsplui.mqtt.mqtt_publish(self.nsplui.config["panelSendTopic"].replace("CustomSend", "FlashNextion"), self.desired_display_firmware_url)
|
||||
|
||||
class NsPanelLovelaceUI:
|
||||
def __init__(self, api, config):
|
||||
self.api = api
|
||||
@@ -92,10 +93,10 @@ class NsPanelLovelaceUI:
|
||||
self.mqtt.mqtt_subscribe(topic=self.config["panelRecvTopic"])
|
||||
self.mqtt.listen_event(self.handle_mqtt_incoming_message, "MQTT_MESSAGE", topic=self.config["panelRecvTopic"], namespace='mqtt')
|
||||
|
||||
if "update_mode" in self.config:
|
||||
update_mode = self.config["update_mode"]
|
||||
if "updateMode" in self.config:
|
||||
update_mode = self.config["updateMode"]
|
||||
else:
|
||||
update_mode = "manual"
|
||||
update_mode = "auto-notify"
|
||||
self.updater = Updater(self, update_mode)
|
||||
|
||||
|
||||
|
||||
3
info.md
3
info.md
@@ -11,7 +11,8 @@ nspanel-1:
|
||||
config:
|
||||
panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
|
||||
panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"
|
||||
timeoutScreensaver: 15 #in seconds, values between 5 and 60 are allowed
|
||||
updateMode: auto-notify # possible values are auto, auto-notify and manual
|
||||
timeoutScreensaver: 15 #in seconds
|
||||
#brightnessScreensaver: 10
|
||||
brightnessScreensaver:
|
||||
- time: "7:00:00"
|
||||
|
||||
Reference in New Issue
Block a user