Fix device class icon not showing in entities config page (#19854)

This commit is contained in:
Paul Bottein 2024-02-22 10:42:37 +01:00 committed by GitHub
parent a6d73f7615
commit 267fc3743d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,8 +198,9 @@ export const entryIcon = async (
if (entry.icon) { if (entry.icon) {
return entry.icon; return entry.icon;
} }
const stateObj = hass.states[entry.entity_id] as HassEntity | undefined;
const domain = computeDomain(entry.entity_id); const domain = computeDomain(entry.entity_id);
return getEntityIcon(hass, domain, undefined, undefined, entry); return getEntityIcon(hass, domain, stateObj, undefined, entry);
}; };
const getEntityIcon = async ( const getEntityIcon = async (