Skip to content

Commit

Permalink
Support state_color config introduced in HA v0.105 (closes #36)
Browse files Browse the repository at this point in the history
  • Loading branch information
benct committed Feb 7, 2020
1 parent ed374b1 commit 29a47a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ resources:
| icon | string | | Override entity `icon`
| toggle | bool | `false` | Display a toggle (if supported) instead of state
| hide_state | bool | `false` | Hide the entity state
| name_state | string | | Add name/header above the main entity state
| name_state | string | | Show name/header above the main entity state
| state_color | bool | false | Enable colored icon when entity is active
| | | |
| primary | object | *see below* | Primary additional entity object
| secondary | object | *see below* | Secondary additional entity object (not to be confused with `secondary_info`)
Expand Down
8 changes: 4 additions & 4 deletions multiple-entity-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
return html`
<state-badge
.stateObj="${this.state.stateObj}"
.overrideIcon="${this.icon}"
.overrideIcon="${this._config.icon}"
.stateColor="${this._config.state_color}"
@click="${this.onClick}">
</state-badge>
<div class="flex">
Expand Down Expand Up @@ -118,10 +119,9 @@
this.checkEntity(config, 'tertiary');
this.checkEntity(config, 'info');

this.icon = config.icon;
this.lastChanged = config.secondary_info === 'last-changed' && !config.info;
this.stateHeader = config.name_state !== undefined ? config.name_state : null,
this.onClick = () => this.fireEvent(config.entity);
this.stateHeader = config.name_state !== undefined ? config.name_state : null;
this.onClick = () => this.fireEvent(config.entity);

this._config = config;
}
Expand Down

0 comments on commit 29a47a4

Please sign in to comment.