Skip to content

Commit 8e68c93

Browse files
committed
1.12.0rc0: Version logging and tidy up card name config passing
1 parent c2fd8b0 commit 8e68c93

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lovelace-timer-bar-card",
3-
"version": "1.11.0",
3+
"version": "1.12.0rc0",
44
"description": "Progress bar display for Home Assistant timers",
55
"keywords": [
66
"home-assistant",

src/timer-bar-card.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { fillConfig, TimerBarEntityRow } from './timer-bar-entity-row';
99
import type { TimerBarConfig, TimerBarEntityConfig, AttributeConfig } from './types';
1010
import { isState } from './helpers';
1111
import { 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

2122
window.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')
2430
export 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

Comments
 (0)