Fallback to state name when the entry doesn't have name (#24805)

This commit is contained in:
Paul Bottein
2025-03-27 18:51:08 +01:00
committed by GitHub
parent 750c59399b
commit f06a0fa34c
2 changed files with 9 additions and 2 deletions

View File

@@ -33,7 +33,14 @@ export const computeEntityEntryName = (
const device = entry.device_id ? hass.devices[entry.device_id] : undefined;
if (!device) {
return name;
if (name) {
return name;
}
const stateObj = hass.states[entry.entity_id] as HassEntity | undefined;
if (stateObj) {
return computeStateName(stateObj);
}
return undefined;
}
const deviceName = computeDeviceName(device);