From 7056ed0dffdcad80b030795a8414080a08b212c0 Mon Sep 17 00:00:00 2001 From: Johannes Date: Wed, 30 Mar 2022 11:02:43 +0200 Subject: [PATCH] added code for us auto update --- apps/nspanel-lovelace-ui/luibackend/config.py | 2 ++ apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/config.py b/apps/nspanel-lovelace-ui/luibackend/config.py index 51ab35d0..9d7ac38b 100644 --- a/apps/nspanel-lovelace-ui/luibackend/config.py +++ b/apps/nspanel-lovelace-ui/luibackend/config.py @@ -100,6 +100,8 @@ class LuiBackendConfig(object): 'panelRecvTopic': "tele/tasmota_your_mqtt_topic/RESULT", 'panelSendTopic': "cmnd/tasmota_your_mqtt_topic/CustomSend", 'updateMode': "auto-notify", + 'model': "eu", + 'orientation': "landscape", 'timeoutScreensaver': 20, 'brightnessScreensaver': 20, 'brightnessScreensaverTracking': None, diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index 9992fd38..3fcdf216 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -65,7 +65,22 @@ class NsPanelLovelaceUIManager(hass.Hass): controller = LuiController(self, cfg, send_mqtt_msg) desired_display_firmware_version = 22 - desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-v2.0.0.tft" + + version = "v2.0.0" + model = cfg.get("model") + orientation = cfg.get("orientation") + if model == "us": + if orientation == "landscape": + # us landscape version + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft" + else: + # us portrait version + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft" + else: + # eu version + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft" + + desired_tasmota_driver_version = 3 desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"