Skip to content

Commit

Permalink
fix: actually really fix the issue with HA 2023.4 beta and above
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Apr 2, 2023
1 parent bac18c6 commit 972f2c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/apexcharts-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -37,6 +37,7 @@ import {
truncateFloat,
validateInterval,
validateOffset,
getLovelace,
} from './utils';
import ApexCharts from 'apexcharts';
import { Ripple } from '@material/mwc-ripple';
Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 972f2c0

Please sign in to comment.