@@ -14,12 +14,19 @@ import {
1414import { DeclutteringCardConfig , TemplateConfig } from './types' ;
1515import deepReplace from './deep-replace' ;
1616import getLovelaceCast from './getLovelaceCast' ;
17+ import { CARD_VERSION } from './version-const' ;
1718
1819const HELPERS = ( window as any ) . loadCardHelpers ? ( window as any ) . loadCardHelpers ( ) : undefined ;
1920
21+ console . info (
22+ `%c DECLUTTERING-CARD \n%c Version ${ CARD_VERSION } ` ,
23+ 'color: orange; font-weight: bold; background: black' ,
24+ 'color: white; font-weight: bold; background: dimgray' ,
25+ ) ;
26+
2027@customElement ( 'decluttering-card' )
2128class DeclutteringCard extends LitElement {
22- @property ( ) private _card ?: any ;
29+ @property ( ) protected _card ?: any ;
2330
2431 @property ( ) private _hass ?: HomeAssistant ;
2532
@@ -47,6 +54,7 @@ class DeclutteringCard extends LitElement {
4754 this . _config = deepReplace ( config . variables , templateConfig ) ;
4855 this . _createCard ( this . _config ) . then ( ( card ) => {
4956 this . _card = card ;
57+ return this . _card ;
5058 } ) ;
5159 }
5260
@@ -74,9 +82,7 @@ class DeclutteringCard extends LitElement {
7482 ev . stopPropagation ( ) ;
7583 this . _rebuildCard ( element , config ) ;
7684 } ,
77- {
78- once : true ,
79- } ,
85+ { once : true } ,
8086 ) ;
8187 return element ;
8288 }
@@ -87,7 +93,7 @@ class DeclutteringCard extends LitElement {
8793 }
8894
8995 public getCardSize ( ) : number {
90- return typeof this . _card . getCardSize === 'function'
96+ return this . _card && typeof this . _card . getCardSize === 'function'
9197 ? this . _card . getCardSize ( ) : 1 ;
9298 }
9399}
0 commit comments