From 9edc09a442b8f1fa08d737c70071e17877f4261f Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 15:45:26 +0200 Subject: [PATCH 1/3] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6c03648f..58a32378 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ assignees: '' This issue template is meant to REPORT BUGS/PROBLEMS ONLY Please take a few minutes to complete the requested information below. -Our ability to provide assistance is greatly hampered without it. +The ability to provide assistance is greatly hampered without it. DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed. --> @@ -49,4 +49,4 @@ _If applicable, add screenshots/pictures to help explain your problem._ ### ADDITIONAL CONTEXT -_Add any other context about the problem here._ \ No newline at end of file +_Add any other context about the problem here._ From 09fee903e207d6b094d92835185c4bb6c2c403cf Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 16:54:00 +0200 Subject: [PATCH 2/3] Update icons.py --- apps/nspanel-lovelace-ui/luibackend/icons.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index d0042417..e3ae3c85 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -74,7 +74,7 @@ cover_mapping = { "window": ("window-open", "window-closed", "arrow-up", "stop", "arrow-down"), } -def map_to_mdi_name(ha_type, state=None, device_class=None, cardType=None): +def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None): if ha_type == "weather": return weather_mapping[state] if state in weather_mapping else "alert-circle-outline" elif ha_type == "button": @@ -96,6 +96,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None, cardType=None): elif ha_type == "input_boolean": return "check-circle-outline" if state == "on" else "close-circle-outline" elif ha_type == "cover": + if device_class is None: + device_class = "window" if state == "closed": return cover_mapping[device_class][1] if device_class in cover_mapping else "alert-circle-outline" else: @@ -103,10 +105,10 @@ def map_to_mdi_name(ha_type, state=None, device_class=None, cardType=None): elif ha_type == "lock": return "lock-open" if state == "unlocked" else "lock" elif ha_type == "sensor": - if state == "on": - return sensor_mapping_on[device_class] if device_class in sensor_mapping_on else "alert-circle-outline" - elif state == "off": - return sensor_mapping_off[device_class] if device_class in sensor_mapping_off else "alert-circle-outline" + if state == "on" and device_class in sensor_mapping_on: + return sensor_mapping_on[device_class] + elif state == "off" and device_class in sensor_mapping_off: + return sensor_mapping_off[device_class] else: return sensor_mapping[device_class] if device_class in sensor_mapping else "alert-circle-outline" elif ha_type == "alarm-arm-fail": From 31e071c924be77baf76ca7ca7d6293fe011c2c13 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 18:05:48 +0200 Subject: [PATCH 3/3] Update localization.py --- apps/nspanel-lovelace-ui/luibackend/localization.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/localization.py b/apps/nspanel-lovelace-ui/luibackend/localization.py index b278aa73..c87b5b84 100644 --- a/apps/nspanel-lovelace-ui/luibackend/localization.py +++ b/apps/nspanel-lovelace-ui/luibackend/localization.py @@ -38,6 +38,8 @@ def get_translation(locale, lookupstr): if res.startswith("error"): path_frontend_file, path_backend_file = build_locale_filestring("en_US") res = lookup(path_frontend_file, path_backend_file, lookupstr) + if locale == "he_IL": + res = res[::-1] return res -#print(get_translation("en_US", "frontend.state_attributes.climate.hvac_action.idle")) \ No newline at end of file +#print(get_translation("en_US", "frontend.state_attributes.climate.hvac_action.idle"))