From 5059f609523224b9f1c580e47760b9d73af18b27 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 20 Mar 2022 20:27:02 +0100 Subject: [PATCH] added auto update to config examples --- README.md | 3 ++- appdaemon/apps.yaml | 3 ++- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 7 ++++--- info.md | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ef085fc..fb337f13 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/appdaemon/apps.yaml b/appdaemon/apps.yaml index fc5b85ef..524f35bb 100644 --- a/appdaemon/apps.yaml +++ b/appdaemon/apps.yaml @@ -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" diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index 6ebda9ee..c36c97d6 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -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) diff --git a/info.md b/info.md index 4b3e2ade..05834e98 100644 --- a/info.md +++ b/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"