fix nav icon overwrite

* Fixes typo

The logic doesn't quite work because if icon is a dict then it tries to call get_icon_id which expects a string icon.

* Wrong code committed - my bad

* Update icons.py

* Update pages.py

Co-authored-by: Johannes <johannes+develop+github@braun-rheingau.de>
This commit is contained in:
illuzn
2022-06-22 03:02:32 +09:30
committed by GitHub
parent 5bd85b235c
commit 3409902cc7
2 changed files with 2 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ cover_mapping = {
def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None): def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None):
if ha_type == "weather": if ha_type == "weather":
return weather_mapping[state] if state in weather_mapping else "alert-circle-outline" return weather_mapping[state] if state in weather_mapping else "alert-circle-outline"
elif ha_type == "button": elif ha_type in ["button", "navigate"]:
return "gesture-tap-button" return "gesture-tap-button"
elif ha_type == "scene": elif ha_type == "scene":
return "palette" return "palette"

View File

@@ -165,7 +165,7 @@ class LuiPagesGen(object):
if entityType == "navigate": if entityType == "navigate":
page_search_res = self._config.searchCard(entityId) page_search_res = self._config.searchCard(entityId)
if page_search_res is not None: if page_search_res is not None:
icon_res = get_icon_id(icon) if icon is not None else get_icon_id("gesture-tap-button") icon_res = get_icon_id_ha("navigate", overwrite=icon)
status_entity = None status_entity = None
name = name if name is not None else page_search_res.title name = name if name is not None else page_search_res.title
text = get_translation(self._locale, "frontend.ui.card.button.press") text = get_translation(self._locale, "frontend.ui.card.button.press")