From 0182bc8d6fee605fdd342030ebdf14197137b4e9 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 28 May 2022 23:27:03 +0200 Subject: [PATCH] fix --- apps/nspanel-lovelace-ui/luibackend/localization.py | 2 +- apps/nspanel-lovelace-ui/luibackend/pages.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index 69a4e020..7c50f543 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -1120,7 +1120,7 @@ def lookup(locale, inputstr): def get_translation(locale, inputstr): inputstr = inputstr.replace("heat", "heating").replace("dry", "drying").replace("cool", "cooling").replace("fan_only", "fan") - if inputstr == "heat_cool": + if inputstr == "heating_cooling": return f'{lookup(locale, "heating")}/{lookup(locale, "cooling")}' return lookup(locale, inputstr) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 0456f4b4..fff1587d 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -281,7 +281,10 @@ class LuiPagesGen(object): current_temp = get_attr_safe(entity, "current_temperature", "") dest_temp = int(get_attr_safe(entity, "temperature", 0)*10) status = get_attr_safe(entity, "hvac_action", "") - state_value = f"{get_translation(self._locale, status)}\r\n({get_translation(self._locale, entity.state)})" + state_value = "" + if status != "": + state_value = f"{get_translation(self._locale, status)}\r\n" + state_value += "({get_translation(self._locale, entity.state)})" min_temp = int(get_attr_safe(entity, "min_temp", 0)*10) max_temp = int(get_attr_safe(entity, "max_temp", 0)*10) step_temp = int(get_attr_safe(entity, "target_temp_step", 0.5)*10)