From 95e3dfa0ea0725499540ec64a43a1e365e2cc9fd Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 25 Mar 2022 20:23:28 +0100 Subject: [PATCH 1/8] Some textual updates --- apps/nspanel-lovelace-ui/luibackend/updater.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/updater.py b/apps/nspanel-lovelace-ui/luibackend/updater.py index aa976850..265eccb0 100644 --- a/apps/nspanel-lovelace-ui/luibackend/updater.py +++ b/apps/nspanel-lovelace-ui/luibackend/updater.py @@ -48,7 +48,7 @@ class Updater: return False # send notification about the update if self.mode == "auto-notify": - update_msg = "There's an update avalible for the tasmota berry driver, do you want to start the update now? If you encounter issues after the update or this message appears frequently, please checkthe manual and repeat the installation steps for the tasmota berry driver. " + update_msg = "There's an update available for the Tasmota Berry driver, do you want to start the update now? If you encounter issues after the update or this message appears frequently, please check the manual and repeat the installation steps for the Tasmota Berry driver. " self.send_message_page("updateBerryNoYes", "Driver Update available!", update_msg, "Dismiss", "Yes") return True return False @@ -61,7 +61,7 @@ class Updater: return False # send notification about the update if self.mode == "auto-notify": - update_msg = "There's a firmware update avalible for the nextion sceen inside of nspanel, do you want to start the update now? If the update fails check the installation manual and flash again over the tasmota console. Be pationed the update will take a while." + update_msg = "There's a firmware update available for the Nextion screen of the NSPanel. Do you want to start 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 11bbad78d1e93335ce5d98c6e127ff969dcf647a Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:25:28 +0100 Subject: [PATCH 2/8] Update localization.py --- .../luibackend/localization.py | 90 ++++++++++++++++++- 1 file changed, 86 insertions(+), 4 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index b59d0d1e..ab26fd3c 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -1,12 +1,94 @@ translations = { + 'af_ZA': { + 'ACTIVATE': "Aktiveer", + }, + 'ca_ES': { + 'PRESS': "Prem", + 'ACTIVATE': "Activar", + }, + 'cs_CZ': { + 'PRESS': "Stisknutí", + 'ACTIVATE': "Aktivovat", + }, + 'cy_GB': { + 'ACTIVATE': "Actifadu", + }, + 'da_DK': { + 'PRESS': "Tryk", + 'ACTIVATE': "Aktiver", + }, 'de_DE': { - 'ACTIVATE': "AKTIVIEREN", - 'PRESS': "DRÜCKEN", - } + 'PRESS': "Drücken", + 'ACTIVATE': "Aktivieren", + }, + 'en_GB': { + }, + 'en_US': { + 'PRESS': "Press", + 'ACTIVATE': "Activate", + }, + 'es_ES': { + 'PRESS': "Pulsa", + 'ACTIVATE': "Activar", + }, + 'et_EE': { + 'PRESS': "Vajuta nuppu", + 'ACTIVATE': "Aktiveeri", + }, + 'eu_ES': { + 'ACTIVATE': "Aktibatu", + }, + 'fi_FI': { + 'PRESS': "Paina", + 'ACTIVATE': "Aktivoi", + }, + 'fr_FR': { + 'PRESS': "Appui", + 'ACTIVATE': "Activer", + }, + 'fy_DE': { + }, + 'gl_ES': { + }, + 'hr_HR': { + 'ACTIVATE': "Aktivirati", + }, + 'id_ID': { + 'PRESS': "Tekan", + 'ACTIVATE': "Aktifkan", + }, + 'is_IS': { + 'PRESS': "Ýttu á", + 'ACTIVATE': "Virkja", + }, + 'it_IT': { + 'PRESS': "Premi", + 'ACTIVATE': "Attiva", + }, + 'nl_NL': { + 'PRESS': "Klik", + 'ACTIVATE': "Activeren", + }, + 'nn_NO': { + 'ACTIVATE': "Aktiver", + }, + 'pt_PT': { + 'PRESS': "Pressione", + 'ACTIVATE': "Ativar", + }, + 'sr_RS': { + 'PRESS': "Pritisnite taster", + 'ACTIVATE': "Aktiviraj", + }, + 'sv_SE': { + 'PRESS': "Tryck", + 'ACTIVATE': "Aktivera", + }, } def get_translation(locale, input): if locale in translations: return translations.get(locale).get(input, input) else: - return input \ No newline at end of file + return input + From f7a768de7cd38704425635326569f6948107de05 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:37:40 +0100 Subject: [PATCH 3/8] Update localization.py --- .../luibackend/localization.py | 95 ++++++++++++++++++- 1 file changed, 92 insertions(+), 3 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index ab26fd3c..f2bdf474 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -1,88 +1,177 @@ translations = { 'af_ZA': { 'ACTIVATE': "Aktiveer", + 'aux_heat': "Aanvullende hitte", + 'cooling': "Koel Af", + 'fan_mode': "Waaier modus", + 'heating': "Verhit", }, 'ca_ES': { 'PRESS': "Prem", 'ACTIVATE': "Activar", + 'aux_heat': "Calefactor auxiliar", + 'cooling': "Refredant", + 'fan_mode': "Velocitat ventilador", + 'heating': "Escalfant", + 'high': "alt", + 'low': "baix", }, 'cs_CZ': { - 'PRESS': "Stisknutí", 'ACTIVATE': "Aktivovat", }, 'cy_GB': { 'ACTIVATE': "Actifadu", + 'high': "Uchel", + 'low': "Isel", }, 'da_DK': { 'PRESS': "Tryk", 'ACTIVATE': "Aktiver", + 'heating': "Opvarmning", + 'low': "lav", }, 'de_DE': { 'PRESS': "Drücken", 'ACTIVATE': "Aktivieren", + 'aux_heat': "Hilfswärme", + 'cooling': "Kühlung", + 'fan_mode': "Ventilator-Modus", + 'heating': "Heizung", + 'high': "hoch", + 'low': "niedrig", }, 'en_GB': { }, 'en_US': { 'PRESS': "Press", 'ACTIVATE': "Activate", + 'aux_heat': "Aux heat", + 'cooling': "Cooling", + 'fan_mode': "Fan mode", + 'heating': "Heating", + 'high': "high", + 'low': "low", }, 'es_ES': { 'PRESS': "Pulsa", 'ACTIVATE': "Activar", + 'aux_heat': "Calor auxiliar", + 'cooling': "Enfriando", + 'fan_mode': "Modo del ventilador", + 'heating': "Calentando", }, 'et_EE': { 'PRESS': "Vajuta nuppu", 'ACTIVATE': "Aktiveeri", + 'aux_heat': "Abiküte", + 'cooling': "Jahutamine", + 'fan_mode': "Ventilaatori režiim", + 'heating': "Küte", + 'high': "kiire", + 'low': "aeglane", }, 'eu_ES': { 'ACTIVATE': "Aktibatu", + 'fan_mode': "Haizagailuaren modua", }, 'fi_FI': { 'PRESS': "Paina", 'ACTIVATE': "Aktivoi", + 'aux_heat': "Lisälämpö", + 'cooling': "Jäähdytys", + 'fan_mode': "Tuuletustila", + 'heating': "Lämmitys", + 'high': "korkea", + 'low': "matala", }, 'fr_FR': { 'PRESS': "Appui", 'ACTIVATE': "Activer", + 'aux_heat': "Chauffage d'appoint", + 'cooling': "Refroidissement", + 'fan_mode': "Mode de ventilation", + 'heating': "En chauffe", + 'high': "haute", + 'low': "basse", }, 'fy_DE': { + 'high': "Heech", + 'low': "Leech", }, 'gl_ES': { + 'high': "Máximo", + 'low': "Mínimo", }, 'hr_HR': { 'ACTIVATE': "Aktivirati", + 'heating': "Grijanje", }, 'id_ID': { 'PRESS': "Tekan", 'ACTIVATE': "Aktifkan", + 'aux_heat': "Pemanasan tambahan", + 'cooling': "Mendinginkan", + 'fan_mode': "Mode kipas", + 'heating': "Memanaskan", + 'high': "tinggi", + 'low': "rendah", }, 'is_IS': { - 'PRESS': "Ýttu á", 'ACTIVATE': "Virkja", + 'cooling': "Kæling", + 'fan_mode': "Viftuhamur", + 'heating': "Kynding", }, 'it_IT': { 'PRESS': "Premi", 'ACTIVATE': "Attiva", + 'aux_heat': "Riscaldamento ausiliario", + 'cooling': "Raffreddamento", + 'fan_mode': "Ventilazione", + 'heating': "Riscaldamento", + 'high': "alto", + 'low': "basso", }, 'nl_NL': { 'PRESS': "Klik", 'ACTIVATE': "Activeren", + 'aux_heat': "Extra warmte", + 'cooling': "Koelen", + 'fan_mode': "Ventilatormodus", + 'heating': "Verwarmen", + 'high': "hoog", + 'low': "laag", }, 'nn_NO': { 'ACTIVATE': "Aktiver", + 'aux_heat': "Aux-varme", + 'fan_mode': "Viftemodus", + 'heating': "Oppvarming", }, 'pt_PT': { 'PRESS': "Pressione", 'ACTIVATE': "Ativar", + 'aux_heat': "Calor auxiliar", + 'cooling': "Resfriar", + 'fan_mode': "Modo ventilar", + 'heating': "Aquecimento", + 'high': "Alta", + 'low': "Baixa", }, 'sr_RS': { 'PRESS': "Pritisnite taster", 'ACTIVATE': "Aktiviraj", + 'high': "Visok", + 'low': "Nizak", }, 'sv_SE': { 'PRESS': "Tryck", 'ACTIVATE': "Aktivera", + 'aux_heat': "Underhållsvärme", + 'cooling': "Kyler", + 'fan_mode': "Fläktläge", + 'heating': "Värmer", + 'high': "hög", }, } @@ -90,5 +179,5 @@ def get_translation(locale, input): if locale in translations: return translations.get(locale).get(input, input) else: - return input + return translations.get("en_US").get(input, input) From ec65eebb7459b1c12b126b3a26b698b76c228a16 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:39:26 +0100 Subject: [PATCH 4/8] Add localization to thermo page status --- apps/nspanel-lovelace-ui/luibackend/pages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 150c29e5..5563102f 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -158,6 +158,7 @@ class LuiPagesGen(object): current_temp = int(entity.attributes.get("current_temperature", 0)*10) dest_temp = int(entity.attributes.get("temperature", 0)*10) status = entity.attributes.get("hvac_action", "") + status = get_translation(self._locale,status) min_temp = int(entity.attributes.get("min_temp", 0)*10) max_temp = int(entity.attributes.get("max_temp", 0)*10) step_temp = int(entity.attributes.get("target_temp_step", 0.5)*10) @@ -274,4 +275,4 @@ class LuiPagesGen(object): def send_message_page(self, id, heading, msg, b1, b2): self._send_mqtt_msg(f"pageType,popupNotify") - self._send_mqtt_msg(f"entityUpdateDetail,|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0") \ No newline at end of file + self._send_mqtt_msg(f"entityUpdateDetail,|{id}|{heading}|65535|{b1}|65535|{b2}|65535|{msg}|65535|0") From 9ae898c30fa56b4a8d8bd7e82ff22c2c61ae4075 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:43:07 +0100 Subject: [PATCH 5/8] Update localization.py --- .../luibackend/localization.py | 150 ++++++++++-------- 1 file changed, 86 insertions(+), 64 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index f2bdf474..d8de8d54 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -3,42 +3,54 @@ translations = { 'ACTIVATE': "Aktiveer", 'aux_heat': "Aanvullende hitte", 'cooling': "Koel Af", - 'fan_mode': "Waaier modus", - 'heating': "Verhit", + 'drying': "Droog Uit", + 'fan': "Waaier", + 'idle': "Onaktief", + 'off': "Af", }, 'ca_ES': { 'PRESS': "Prem", 'ACTIVATE': "Activar", 'aux_heat': "Calefactor auxiliar", 'cooling': "Refredant", - 'fan_mode': "Velocitat ventilador", - 'heating': "Escalfant", - 'high': "alt", - 'low': "baix", + 'drying': "Assecant", + 'fan': "Ventilació", + 'idle': "Inactiu", + 'off': "OFF", }, 'cs_CZ': { + 'PRESS': "Stisknutí", 'ACTIVATE': "Aktivovat", + 'aux_heat': "Pomocné teplo", + 'cooling': "Chlazení", + 'drying': "Sušení", + 'fan': "Ventilátor", + 'idle': "Nečinný", + 'off': "Vypnuto", }, 'cy_GB': { 'ACTIVATE': "Actifadu", - 'high': "Uchel", - 'low': "Isel", + 'off': "I ffwrdd", }, 'da_DK': { 'PRESS': "Tryk", 'ACTIVATE': "Aktiver", - 'heating': "Opvarmning", - 'low': "lav", + 'aux_heat': "Støtte-varme", + 'cooling': "Køling", + 'drying': "Tørring", + 'fan': "Blæser", + 'idle': "Inaktiv", + 'off': "Fra", }, 'de_DE': { 'PRESS': "Drücken", 'ACTIVATE': "Aktivieren", 'aux_heat': "Hilfswärme", 'cooling': "Kühlung", - 'fan_mode': "Ventilator-Modus", - 'heating': "Heizung", - 'high': "hoch", - 'low': "niedrig", + 'drying': "Trocknen", + 'fan': "Ventilator", + 'idle': "Leerlauf", + 'off': "Aus", }, 'en_GB': { }, @@ -47,131 +59,142 @@ translations = { 'ACTIVATE': "Activate", 'aux_heat': "Aux heat", 'cooling': "Cooling", - 'fan_mode': "Fan mode", - 'heating': "Heating", - 'high': "high", - 'low': "low", + 'drying': "Drying", + 'fan': "Fan", + 'idle': "Idle", + 'off': "Off", }, 'es_ES': { 'PRESS': "Pulsa", 'ACTIVATE': "Activar", 'aux_heat': "Calor auxiliar", 'cooling': "Enfriando", - 'fan_mode': "Modo del ventilador", - 'heating': "Calentando", + 'drying': "Secando", + 'fan': "Ventilador", + 'idle': "Inactivo", + 'off': "Apagado", }, 'et_EE': { 'PRESS': "Vajuta nuppu", 'ACTIVATE': "Aktiveeri", 'aux_heat': "Abiküte", 'cooling': "Jahutamine", - 'fan_mode': "Ventilaatori režiim", - 'heating': "Küte", - 'high': "kiire", - 'low': "aeglane", + 'drying': "Kuivatamine", + 'fan': "Ventilaator", + 'idle': "Ootel", + 'off': "Väljas", }, 'eu_ES': { 'ACTIVATE': "Aktibatu", - 'fan_mode': "Haizagailuaren modua", + 'off': "Itzalita", }, 'fi_FI': { 'PRESS': "Paina", 'ACTIVATE': "Aktivoi", 'aux_heat': "Lisälämpö", 'cooling': "Jäähdytys", - 'fan_mode': "Tuuletustila", - 'heating': "Lämmitys", - 'high': "korkea", - 'low': "matala", + 'drying': "Kuivaus", + 'fan': "Tuuletin", + 'idle': "Lepotilassa", + 'off': "Pois", }, 'fr_FR': { 'PRESS': "Appui", 'ACTIVATE': "Activer", 'aux_heat': "Chauffage d'appoint", 'cooling': "Refroidissement", - 'fan_mode': "Mode de ventilation", - 'heating': "En chauffe", - 'high': "haute", - 'low': "basse", + 'drying': "Séchage", + 'fan': "Ventilateur", + 'idle': "Inactif", + 'off': "Off", }, 'fy_DE': { - 'high': "Heech", - 'low': "Leech", + 'off': "Út", }, 'gl_ES': { - 'high': "Máximo", - 'low': "Mínimo", + 'off': "Apagado", }, 'hr_HR': { 'ACTIVATE': "Aktivirati", - 'heating': "Grijanje", + 'aux_heat': "Pomoćno grijanje", + 'cooling': "Hlađenje", + 'drying': "Sušenje", + 'fan': "Ventilator", + 'idle': "Neaktivan", + 'off': "Isključen", }, 'id_ID': { 'PRESS': "Tekan", 'ACTIVATE': "Aktifkan", 'aux_heat': "Pemanasan tambahan", 'cooling': "Mendinginkan", - 'fan_mode': "Mode kipas", - 'heating': "Memanaskan", - 'high': "tinggi", - 'low': "rendah", + 'drying': "Mengeringkan", + 'fan': "Kipas", + 'idle': "Diam", + 'off': "Mati", }, 'is_IS': { + 'PRESS': "Ýttu á", 'ACTIVATE': "Virkja", 'cooling': "Kæling", - 'fan_mode': "Viftuhamur", - 'heating': "Kynding", + 'drying': "Þurrkun", + 'fan': "Vifta", + 'idle': "Aðgerðalaus", + 'off': "Slökkt", }, 'it_IT': { 'PRESS': "Premi", 'ACTIVATE': "Attiva", 'aux_heat': "Riscaldamento ausiliario", 'cooling': "Raffreddamento", - 'fan_mode': "Ventilazione", - 'heating': "Riscaldamento", - 'high': "alto", - 'low': "basso", + 'drying': "Deumidificazione", + 'fan': "Ventilatore", + 'idle': "Inattivo", + 'off': "Spento", }, 'nl_NL': { 'PRESS': "Klik", 'ACTIVATE': "Activeren", 'aux_heat': "Extra warmte", 'cooling': "Koelen", - 'fan_mode': "Ventilatormodus", - 'heating': "Verwarmen", - 'high': "hoog", - 'low': "laag", + 'drying': "Ontvochtigen", + 'fan': "Ventilator", + 'idle': "Inactief", + 'off': "Uit", }, 'nn_NO': { 'ACTIVATE': "Aktiver", 'aux_heat': "Aux-varme", - 'fan_mode': "Viftemodus", - 'heating': "Oppvarming", + 'cooling': "Nedkjøling", + 'drying': "Tørkar", + 'fan': "Vifte", + 'idle': "Tomgang", + 'off': "Av", }, 'pt_PT': { 'PRESS': "Pressione", 'ACTIVATE': "Ativar", 'aux_heat': "Calor auxiliar", 'cooling': "Resfriar", - 'fan_mode': "Modo ventilar", - 'heating': "Aquecimento", - 'high': "Alta", - 'low': "Baixa", + 'drying': "Secagem", + 'fan': "Ventoinha", + 'idle': "Em espera", + 'off': "Desligado", }, 'sr_RS': { 'PRESS': "Pritisnite taster", 'ACTIVATE': "Aktiviraj", - 'high': "Visok", - 'low': "Nizak", + 'off': "Isključen", }, 'sv_SE': { 'PRESS': "Tryck", 'ACTIVATE': "Aktivera", 'aux_heat': "Underhållsvärme", 'cooling': "Kyler", - 'fan_mode': "Fläktläge", - 'heating': "Värmer", - 'high': "hög", + 'drying': "Avfuktar", + 'fan': "Fläkt", + 'idle': "Inaktiv", + 'off': "Av", }, } @@ -180,4 +203,3 @@ def get_translation(locale, input): return translations.get(locale).get(input, input) else: return translations.get("en_US").get(input, input) - From a4344ade18097fe96d458cc294f743f47b7d9205 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:50:45 +0100 Subject: [PATCH 7/8] send brightness and timeout on startup --- apps/nspanel-lovelace-ui/luibackend/controller.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 2daa6060..6b719fd0 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -58,6 +58,13 @@ class LuiController(object): self._pages_gen.update_time("") self._pages_gen.update_date("") + # set screensaver timeout + timeout = self._config.get("timeoutScreensaver") + self._send_mqtt_msg(f"timeout,{timeout}") + + # set current screensaver brightness + self.update_screensaver_brightness(kwargs={"value": self.current_screensaver_brightness}) + # send panel to screensaver self._pages_gen.page_type("screensaver") self.weather_update("") @@ -175,4 +182,4 @@ class LuiController(object): # for climate page if button_type == "tempUpd": temp = int(value)/10 - self._ha_api.get_entity(entity_id).call_service("set_temperature", temperature=temp) \ No newline at end of file + self._ha_api.get_entity(entity_id).call_service("set_temperature", temperature=temp) From 05d6ee1f5f0344540930b6205cf2370cb217115a Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 25 Mar 2022 20:58:04 +0100 Subject: [PATCH 8/8] fixed localization for buttons --- apps/nspanel-lovelace-ui/luibackend/pages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 5563102f..d2ca07b4 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -132,10 +132,11 @@ class LuiPagesGen(object): return f",text,{item},{icon_id},{icon_color},{name},{value}" if item_type in ["button", "input_button"]: icon_id = get_icon_id_ha("button", overwrite=icon) - return f",button,{item},{icon_id},17299,{name},PRESS" + text = get_translation(self._locale,"PRESS") + return f",button,{item},{icon_id},17299,{name},{text}" if item_type == "scene": icon_id = get_icon_id_ha("scene", overwrite=icon) - text = get_translation(self._locale,"PRESS") + text = get_translation(self._locale,"ACTIVATE") return f",button,{item},{icon_id},17299,{name},{text}"