From 528533a2dde0f3145ada7ac1351a42f3a6c344cf Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:33:28 -0500 Subject: [PATCH] Combine climate graph with temperature device_classes (#19485) --- src/data/history.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/data/history.ts b/src/data/history.ts index a110c8c634..baece3da37 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -470,9 +470,15 @@ export const computeHistory = ( }[domain]; } - const deviceClass: string | undefined = ( - currentState?.attributes || numericStateFromHistory?.a - )?.device_class; + const specialDomainClasses = { + climate: "temperature", + humidifier: "humidity", + water_heater: "temperature", + }; + + const deviceClass: string | undefined = + specialDomainClasses[domain] || + (currentState?.attributes || numericStateFromHistory?.a)?.device_class; const key = computeGroupKey(unit, deviceClass, splitDeviceClasses);