This commit is contained in:
joBr99
2023-06-11 00:58:15 +02:00
parent e40017c66e
commit 23beb90591
2 changed files with 7 additions and 6 deletions

View File

@@ -160,21 +160,22 @@ class LuiController(object):
res_uuid = "uuid.notfound"
if entity in sum(entities_on_card.values(), []):
for uuid, names in entities_on_card.items():
apis.ha_api.log(f"test124 items: {entities_on_card.items()} names: {names}")
#apis.ha_api.log(f"test124 items: {entities_on_card.items()} names: {names}")
#apis.ha_api.log(f"State change callback matched for entity on current page: {names}")
if entity in names:
res_uuid = uuid
#apis.ha_api.log(f"Callback Entity is on current page: {entity}")
self._pages_gen.render_card(self._current_card, send_page_type=False)
# send detail page update, just in case
if self._current_card.cardType in ["cardGrid", "cardEntities", "cardMedia"]:
if self._current_card.cardType in ["cardGrid", "cardGrid2", "cardEntities", "cardMedia"]:
if entity.startswith("light"):
self._pages_gen.generate_light_detail_page(res_uuid)
if entity.startswith("cover"):
self._pages_gen.generate_shutter_detail_page(entity)
if entity.startswith("fan"):
self._pages_gen.generate_fan_detail_page(entity)
if entity.startswith("input_select"):
if entity.startswith("input_select") or entity.startswith("select"):
self._pages_gen.generate_input_select_detail_page(entity)
if entity.startswith("media_player"):
self._pages_gen.generate_input_select_detail_page(entity)

View File

@@ -212,7 +212,7 @@ class LuiPagesGen(object):
if status_entity:
icon_res = get_icon_ha(item.status, overwrite=icon)
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid" and item.iconOverride is None:
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
icon_res = status_entity.state[:4]
if icon_res[-1] == ".":
icon_res = icon_res[:-1]
@@ -236,7 +236,7 @@ class LuiPagesGen(object):
if status_entity:
icon_id = get_icon_ha(item.status, overwrite=icon)
icon_color = self.get_entity_color(status_entity, ha_type=item.status.split(".")[0], overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid" and item.iconOverride is None:
if item.status.startswith("sensor") and (cardType == "cardGrid" or cardType == "cardGrid2") and item.iconOverride is None:
icon_id = status_entity.state[:4]
if icon_id[-1] == ".":
icon_id = icon_id[:-1]
@@ -309,7 +309,7 @@ class LuiPagesGen(object):
value = value + unit_of_measurement
if entityType == "binary_sensor":
value = get_translation(self._locale, f"backend.component.binary_sensor.state.{device_class}.{entity.state}")
if cardType == "cardGrid" and entityType == "sensor" and icon is None:
if (cardType == "cardGrid" or cardType == "cardGrid2") and entityType == "sensor" and icon is None:
icon_id = entity.state[:4]
if icon_id[-1] == ".":
icon_id = icon_id[:-1]