From 49cd31e58cce5f545be201691a427b1ab35a7de5 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 09:06:53 +0200 Subject: [PATCH 01/11] bump version --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index 853b2cdf..ba51a59e 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -28,7 +28,7 @@ class NsPanelLovelaceUIManager(hass.Hass): controller = LuiController(self, cfg, send_mqtt_msg) desired_display_firmware_version = 32 - version = "v2.7.2" + version = "v2.7.3" model = cfg.get("model") if model == "us-l": From caf9fd9dc9c003297103b5720108d0be090a6a1a Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 09:39:50 +0200 Subject: [PATCH 02/11] added lang list --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index ff953115..40c87f36 100644 --- a/README.md +++ b/README.md @@ -349,6 +349,48 @@ key | optional | type | default | description `screensaver` | True | complex | | configuration for screensaver `hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items +Possible languages for locale config key: + + - `af_xx` - Afrikaans + - `ar_xx` - Arabic + - `bg_xx` - Bulgarian + - `ca_xx` - Catalan + - `cs_xx` - Czech + - `da_xx` - Danish + - `de_xx` - German + - `el_xx` - Greek + - `en_xx` - English + - `es_xx` - Spanish + - `et_xx` - Estonian + - `fa_xx` - Persian + - `fi_xx` - Finnish + - `fr_xx` - French + - `he_xx` - Hebrew + - `hr_xx` - Croatian + - `hu_xx` - Hungarian + - `hy_xx` - Armenian + - `id_xx` - Indonesian + - `is_xx` - Icelandic + - `it_xx` - Italian + - `lb_xx` - Luxembourgish + - `lt_xx` - Lithuanian + - `lv_xx` - Latvian + - `nb_xx` - Norwegian + - `nl_xx` - Dutch + - `nn_xx` - Norwegian + - `pl_xx` - Polish + - `pt_xx` - Portuguese + - `ro_xx` - Romanian + - `ru_xx` - Russian + - `sk_xx` - Slovak + - `sl_xx` - Slovenian + - `sv_xx` - Swedish + - `th_xx` - Thai + - `tr_xx` - Turkish + - `uk_xx` - Ukrainian + - `vi_xx` - Vietnamese + + Possible configuration values for a card in card config: key | optional | type | default | description From 3649e8a2724896da385412189568bd37ab5d7075 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 09:42:59 +0200 Subject: [PATCH 03/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 40c87f36..47f2c089 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ EU Model and US Model supported (in portrait and landscape orientation) - Media Player Card - Alarm Control Panel - Screensaver Page with Time, Date and Weather Information +- **Everything is dynamically configurable by a yaml config, no need to code or touch Nextion Editor** It works with [Tasmota](https://tasmota.github.io/docs/) and MQTT. To control the panel and update it with content from HomeAssistant there is an [AppDaemon](https://github.com/AppDaemon/appdaemon) App. From f7ed94ea0ad9339298516baa312077de6c8ef1dc Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 09:44:28 +0200 Subject: [PATCH 04/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 47f2c089..3c45d0ca 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ EU Model and US Model supported (in portrait and landscape orientation) - Media Player Card - Alarm Control Panel - Screensaver Page with Time, Date and Weather Information +- Localization possible (currently 38 languages) - **Everything is dynamically configurable by a yaml config, no need to code or touch Nextion Editor** It works with [Tasmota](https://tasmota.github.io/docs/) and MQTT. From f746b9218da136110d3f3d7f7a58b05b89ade1af Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 09:53:42 +0200 Subject: [PATCH 05/11] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 3c45d0ca..a85eee6e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in th EU Model and US Model supported (in portrait and landscape orientation) +Content of the screen is controlled by a AppDaemon Python Script installed on your HomeAssistant Instance. + +(or a TypeScript on your ioBroker Instance in case you are an ioBroker User) + ## Features - Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light From 5d6b7d0cd666f59927aa4c8f30d29270bcaad117 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 16 Apr 2022 20:07:57 +0200 Subject: [PATCH 06/11] Update updater.py --- apps/nspanel-lovelace-ui/luibackend/updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/updater.py b/apps/nspanel-lovelace-ui/luibackend/updater.py index 12418514..1ee6e1e8 100644 --- a/apps/nspanel-lovelace-ui/luibackend/updater.py +++ b/apps/nspanel-lovelace-ui/luibackend/updater.py @@ -72,7 +72,7 @@ class Updater: return False # send notification about the update if self.mode == "auto-notify": - update_msg = "There's a firmware update available for the Nextion screen of the NSPanel. Do you want tostart the update now? If the update fails check the installation manual and flash again over the Tasmota console. Be patient, the update will take a while." + update_msg = "There's a firmware update available for the Nextion screen of the NSPanel. Do you want tostart the update now? If the update fails check the installation manual and flash again over the Tasmota console. Be patient, the update will take a while." self.send_message_page("updateDisplayNoYes", "Display Update available!", update_msg, "Dismiss", "Yes") return True return False From 3caeb486f84fecd82b20e00876a0d77ac6192da9 Mon Sep 17 00:00:00 2001 From: scoobee81 <51600820+scoobee81@users.noreply.github.com> Date: Sun, 17 Apr 2022 17:18:50 +1000 Subject: [PATCH 07/11] Added note about configuration of the appdaemon yaml (#151) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a85eee6e..0a062017 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,8 @@ US Version Landscape: `FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft` For the app to work you need a working MQTT Configuration in AppDaemon. Please add the configuration of your mqtt server, user and password to your existing `appdaemon.yaml` +NOTE: This are not the options of the AppDaemon Addon in HomeAssistant. You will find this file under: `config/appdaemon/appdeamon.yaml` + ```yaml --- secrets: /config/secrets.yaml From 695a3965e028b7eb1fc7de01d108e9541c6e28eb Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 17 Apr 2022 09:24:02 +0200 Subject: [PATCH 08/11] remove unused var --- apps/nspanel-lovelace-ui/luibackend/controller.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 4b131d95..1b029b96 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -66,8 +66,6 @@ class LuiController(object): def update_screensaver_brightness_state_callback(self, entity, attribute, old, new, kwargs): - x = type(self._config.get("sleepBrightness")) - y = self._config.get("sleepBrightness") if type(self._config.get("sleepBrightness")) == str: self.current_screensaver_brightness = self.calc_current_screensaver_brightness() self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness}) From c9b79a71520b36fe920ad3d62673682073e1a83b Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 17 Apr 2022 09:24:37 +0200 Subject: [PATCH 09/11] remove unused imports --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index ba51a59e..f4885c18 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -1,6 +1,3 @@ -import logging -import traceback - import hassapi as hass from luibackend.config import LuiBackendConfig From 400c57f98e46e1541058b671802ba29d87a48a60 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 17 Apr 2022 09:32:41 +0200 Subject: [PATCH 10/11] Update localization.py --- .../luibackend/localization.py | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index a6589250..ec6f066e 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -509,25 +509,6 @@ translations = { 'disarm': "Rozbrój", 'run': "Uruchom", }, - 'pt': { - 'PRESS': "Pressione", - 'ACTIVATE': "Ativar", - 'aux_heat': "Aquecedor aux", - 'cooling': "Resfriando", - 'drying': "Secando", - 'fan': "Ventilando", - 'idle': "Oscioso", - 'off': "Desligado", - 'arm_away': "Armar ausente", - 'arm_custom_bypass': "Bypass personalizado", - 'arm_home': "Armar em casa", - 'arm_night': "Acionamento noturno", - 'arm_vacation': "Armar férias", - 'clear_code': "Limpar", - 'code': "Código", - 'disarm': "Desarmar", - 'run': "Executar", - }, 'pt': { 'PRESS': "Pressione", 'ACTIVATE': "Ativar", @@ -712,8 +693,7 @@ translations = { } def get_translation(locale, input): - locale = locale.split("_")[0] - en_fallback_res = translations.get("en").get(input, input) + en_fallback_res = translations.get("en_US").get(input, input) if locale in translations: return translations.get(locale).get(input, en_fallback_res) else: From d65e03ad6dc98372076f1e7ada858bfeacfcf30a Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 17 Apr 2022 09:34:23 +0200 Subject: [PATCH 11/11] Update localization.py --- apps/nspanel-lovelace-ui/luibackend/localization.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index ec6f066e..d5d8e3f8 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -693,7 +693,8 @@ translations = { } def get_translation(locale, input): - en_fallback_res = translations.get("en_US").get(input, input) + locale = locale.split("_")[0] + en_fallback_res = translations.get("en").get(input, input) if locale in translations: return translations.get(locale).get(input, en_fallback_res) else: