From 972f2c0150df923790cf30108ab90fed46db482f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Wiedemann?= Date: Sun, 2 Apr 2023 18:46:02 +0000 Subject: [PATCH] fix: actually really fix the issue with HA 2023.4 beta and above Fix #529 --- src/apexcharts-card.ts | 3 ++- src/utils.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apexcharts-card.ts b/src/apexcharts-card.ts index 9804a4f..3f9cc1f 100644 --- a/src/apexcharts-card.ts +++ b/src/apexcharts-card.ts @@ -12,7 +12,7 @@ import { HistoryPoint, minmax_type, } from './types'; -import { getLovelace, handleAction, HomeAssistant } from 'custom-card-helpers'; +import { handleAction, HomeAssistant } from 'custom-card-helpers'; import localForage from 'localforage'; import * as pjson from '../package.json'; import { @@ -37,6 +37,7 @@ import { truncateFloat, validateInterval, validateOffset, + getLovelace, } from './utils'; import ApexCharts from 'apexcharts'; import { Ripple } from '@material/mwc-ripple'; diff --git a/src/utils.ts b/src/utils.ts index 460bbd8..9716d16 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -153,7 +153,8 @@ export function getPercentFromValue(value: number, min: number | undefined, max: return ((value - lMin) * 100) / (lMax - lMin); } -export function getLovelace(): LovelaceConfig | null { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function getLovelace(): any | null { // eslint-disable-next-line @typescript-eslint/no-explicit-any let root: any = document.querySelector('home-assistant'); root = root && root.shadowRoot;