File tree Expand file tree Collapse file tree 4 files changed +7
-3
lines changed
Expand file tree Collapse file tree 4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ function renderApp() {
7575 } ;
7676
7777 // Expose setHass to the parent window (panel-wrapper.ts)
78- ( window as any ) . setHass = ( newHass : HomeAssistant ) => {
78+ window . setHass = ( newHass : HomeAssistant | undefined ) => {
7979 render ( newHass ) ;
8080 } ;
8181
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ declare const window: Window & {
1010 hass ?: HomeAssistant ;
1111} ;
1212
13+
1314class CafePanelWrapper extends HTMLElement {
1415 private _messageHandler ?: ( event : MessageEvent ) => void ;
1516 private iframe : HTMLIFrameElement | null = null ;
@@ -22,8 +23,9 @@ class CafePanelWrapper extends HTMLElement {
2223 window . hass = value ;
2324
2425 // Notify the iframe of the update if it has registered a listener
25- if ( this . iframe ?. contentWindow && ( this . iframe . contentWindow as any ) . setHass ) {
26- ( this . iframe . contentWindow as any ) . setHass ( value ) ;
26+ const iframeWindow = this . iframe ?. contentWindow as ( Window & typeof globalThis ) | null ;
27+ if ( iframeWindow ?. setHass ) {
28+ iframeWindow . setHass ( value ) ;
2729 }
2830 }
2931
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { HomeAssistant } from './hass';
33declare global {
44 interface Window {
55 hass ?: HomeAssistant ;
6+ setHass ?: ( hass : HomeAssistant | undefined ) => void ;
67 cafeNarrow ?: boolean ;
78 cafeRoute ?: unknown ;
89 cafePanel ?: unknown ;
Original file line number Diff line number Diff line change @@ -1111,6 +1111,7 @@ export class YamlParser {
11111111 }
11121112 } ;
11131113
1114+ // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: large dispatch switch, refactoring deferred
11141115 actions . forEach ( ( action , index ) => {
11151116 if ( ! action || typeof action !== 'object' ) {
11161117 // Unknown action type - create unknown node
You can’t perform that action at this time.
0 commit comments