From 69e52c3c20e19a22cb60e51fda7f1a2e84373504 Mon Sep 17 00:00:00 2001 From: Johannes 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 d0fbf36f79f884515f7e82a5d8244183214cb95d Mon Sep 17 00:00:00 2001 From: Johannes 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 7bc478bb8433206294706f48485a46e8ab36479f Mon Sep 17 00:00:00 2001 From: Johannes 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 718be2be8927b135011877de2157a54247aa6879 Mon Sep 17 00:00:00 2001 From: Johannes 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 961cc98c172c7f31d829ac4ba450bd4983b106d7 Mon Sep 17 00:00:00 2001 From: Johannes 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 8b27397fac98cc887ee72a4399d51d77f688e2c2 Mon Sep 17 00:00:00 2001 From: Johannes 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 29cf1390a2670a8880ac3a78b0febffa2f1a864c 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 27baa398de127374acda1e5e6d7cd150bb03bd56 Mon Sep 17 00:00:00 2001 From: Johannes 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 6de47d87929ce9e7e327507020661fcf60a591c6 Mon Sep 17 00:00:00 2001 From: Johannes 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 0aad345ce1ba4e56bb250d348a8dd274337a74c9 Mon Sep 17 00:00:00 2001 From: Johannes 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 56a905d51f205c6cbbb8a4f9d01ef7f8dd7b7d04 Mon Sep 17 00:00:00 2001 From: Johannes 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: