Skip to content

Commit

Permalink
Try fix text not found
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPru authored Nov 22, 2022
1 parent ba00bb0 commit 05e0a75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/luxtronik/helpers/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ def get_sensor_value_text(
"""Get a sensor value text."""
global __content_sensor_locale__
global __content_sensor_default__
if __content_sensor_locale__ is None and lang != LANG_DEFAULT:
__content_sensor_locale__ = _load_lang_from_file(
f"../translations/{platform}.{lang}.json", log_warning=False
)
if __content_sensor_default__ is None:
__content_sensor_default__ = _load_lang_from_file(
f"../translations/{platform}.{LANG_DEFAULT}.json", log_warning=False
)
if __content_sensor_locale__ is None and lang != LANG_DEFAULT:
__content_sensor_locale__ = _load_lang_from_file(
f"../translations/{platform}.{lang}.json", log_warning=False
)
else:
lang = LANG_DEFAULT
content = (
__content_sensor_default__
if lang == LANG_DEFAULT
Expand Down

0 comments on commit 05e0a75

Please sign in to comment.