added auto update to config examples

This commit is contained in:
joBr99
2022-03-20 20:27:02 +01:00
parent 1a3d1f1266
commit 5059f60952
4 changed files with 10 additions and 6 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)

View File

@@ -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"