Fix double history graphs for a disabled entity (#25604)

This commit is contained in:
Petar Petrov 2025-05-27 10:08:58 +03:00 committed by GitHub
parent 3532cfa974
commit cba3e4df7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -640,6 +640,12 @@ export const mergeHistoryResults = (
} }
for (const item of ltsResult.line) { for (const item of ltsResult.line) {
if (item.unit === BLANK_UNIT) {
// disabled entities have no unit, so we need to find the unit from the history result
item.unit =
historyResult.line.find((line) => line.identifier === item.identifier)
?.unit ?? BLANK_UNIT;
}
const key = computeGroupKey( const key = computeGroupKey(
item.unit, item.unit,
item.device_class, item.device_class,