From 93cdc3d83104fc0d5e606bbf9d022d9f412151d3 Mon Sep 17 00:00:00 2001 From: illuzn <57167030+illuzn@users.noreply.github.com> Date: Sun, 22 May 2022 14:57:58 +0930 Subject: [PATCH] Laying down groundwork for better cover icons Uses device_class to distinguish between different types of cover and passes to get_icon_id_ha. If device_class is not configured, defaults to None (window) as fallback. --- apps/nspanel-lovelace-ui/luibackend/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 2cacdd8c..14f37aca 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -143,7 +143,7 @@ class LuiPagesGen(object): entity = self._ha_api.get_entity(entityId) name = name if name is not None else entity.attributes.friendly_name if entityType == "cover": - icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon) + icon_id = get_icon_id_ha("cover", state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon) pos = int(entity.attributes.get("current_position", 50)) if pos == 100: status = "0|1"