Skip to content

Commit

Permalink
3.1.3
Browse files Browse the repository at this point in the history
Signed-off-by: Gluwc <[email protected]>
  • Loading branch information
Gluwc committed Apr 29, 2020
1 parent 2613a6e commit 9edde87
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
15 changes: 8 additions & 7 deletions src/bar-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class BarCard extends LitElement {
return html`
<ha-card
.header=${this._config.title ? this._config.title : null}
style="${this._config.entity_row ? 'background: #0000;' : ''}"
style="${this._config.entity_row ? 'background: #0000; box-shadow: none;' : ''}"
>
<div id="states" class="card-content" style="${this._config.entity_row ? 'padding: 0px;' : ''}">
${this._createBarArray()}
Expand Down Expand Up @@ -357,7 +357,7 @@ export class BarCard extends LitElement {
// Set bar width if configured.
let barWidth = '';
if (config.width) {
if (config.direction == 'up') alignItems = 'center';
alignItems = 'center';
barWidth = `width: ${config.width}`;
}

Expand All @@ -375,10 +375,7 @@ export class BarCard extends LitElement {
// Add current bar to row array.
currentRowArray.push(html`
<bar-card-card
style="flex-direction: ${flexDirection}; align-items: ${alignItems}; height: ${barHeight}${typeof barHeight ==
'number'
? 'px'
: ''};"
style="flex-direction: ${flexDirection}; align-items: ${alignItems};"
@action=${this._handleAction}
.config=${config}
.actionHandler=${actionHandler({
Expand All @@ -388,7 +385,11 @@ export class BarCard extends LitElement {
})}
>
${iconOutside} ${indicatorOutside} ${nameOutside}
<bar-card-background style="margin: ${backgroundMargin}; ${barWidth}">
<bar-card-background
style="margin: ${backgroundMargin}; height: ${barHeight}${typeof barHeight == 'number'
? 'px'
: ''}; ${barWidth}"
>
<bar-card-backgroundbar style="--bar-color: ${barColor};"></bar-card-backgroundbar>
${config.animation.state == 'on'
? html`
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const CARD_VERSION = '3.1.2';
export const CARD_VERSION = '3.1.3';
26 changes: 17 additions & 9 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
private _entityOptionsArray: object[] = [];
private _options: any;

// protected shouldUpdate(changedProps: PropertyValues): boolean {
// return hasConfigOrEntitiesChanged(this, changedProps, false);
// }
protected shouldUpdate(changedProps: PropertyValues): boolean {
return hasConfigOrEntitiesChanged(this, changedProps, false);
}

public setConfig(config: BarCardConfig): void {
this._config = { ...config };
Expand Down Expand Up @@ -204,7 +204,7 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
></ha-icon>
</div>
<div class="value" style="flex-grow: 1;">
<paper-dropdown-menu
<!-- <paper-dropdown-menu
label="Entity"
@value-changed=${this._valueChanged}
.configAttribute=${'entity'}
Expand All @@ -218,12 +218,20 @@ export class BarCardEditor extends LitElement implements LovelaceCardEditor {
fallback-selection="0"
>
${entities.map(entity => {
return html`
<paper-item>${entity}</paper-item>
`;
})}
return html`
<paper-item>${entity}</paper-item>
`;
})}
</paper-listbox>
</paper-dropdown-menu>
</paper-dropdown-menu> -->
<paper-input
label="Entity"
@value-changed=${this._valueChanged}
.configAttribute=${'entity'}
.configObject=${this._configArray[index]}
.value=${config.entity}
>
</paper-input>
</div>
${index !== 0
? html`
Expand Down

0 comments on commit 9edde87

Please sign in to comment.