@@ -9,6 +9,7 @@ import { fillConfig, TimerBarEntityRow } from './timer-bar-entity-row';
99import type { TimerBarConfig , TimerBarEntityConfig , AttributeConfig } from './types' ;
1010import { isState } from './helpers' ;
1111import { PropertyValues } from 'lit-element' ;
12+ import { version } from '../package.json' ;
1213
1314// This puts your card into the UI card picker dialog
1415( window as any ) . customCards = ( window as any ) . customCards || [ ] ;
@@ -19,6 +20,11 @@ import { PropertyValues } from 'lit-element';
1920} ) ;
2021
2122window . customElements . define ( 'timer-bar-entity-row' , TimerBarEntityRow ) ;
23+ console . info (
24+ `%c TIMER-BAR-CARD %c Version ${ version } ` ,
25+ 'font-weight: bold; background: #aeb' ,
26+ 'font-weight: bold; background: #ddd' ,
27+ ) ;
2228
2329@customElement ( 'timer-bar-card' )
2430export class TimerBarCard extends LitElement {
@@ -95,9 +101,12 @@ export class TimerBarCard extends LitElement {
95101 private _renderContent ( ) : TemplateResult [ ] {
96102 return this . _filteredEntities ( ) . map ( entity => {
97103 const style = this . config . compressed ? { height : '36px' } : { } ;
98- let config = { ...this . config , entity, name : '' } ;
104+ let config : TimerBarEntityConfig = { ...this . config } ;
105+ delete config . name // so card name does not override entity name
99106 // Merge in per-entity configuration
100- if ( typeof entity !== 'string' ) config = { ...config , ...entity } ;
107+ if ( typeof entity === 'string' ) config . entity = entity ;
108+ else config = { ...config , ...entity } ;
109+ // Create a entity-row component for every entity
101110 return html `<timer- bar- entity- row
102111 .config = ${ config }
103112 .hass = ${ this . hass }
0 commit comments