From cba3e4df7f6b963c82cae847a72261c05a46bd46 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 27 May 2025 10:08:58 +0300 Subject: [PATCH] Fix double history graphs for a disabled entity (#25604) --- src/data/history.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/history.ts b/src/data/history.ts index fb784b54f4..553421d404 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -640,6 +640,12 @@ export const mergeHistoryResults = ( } 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( item.unit, item.device_class,