()
| 43 | } |
| 44 | |
| 45 | render() { |
| 46 | return html` |
| 47 | ${this.rows.map(row => { |
| 48 | return html` |
| 49 | <div class="flex-box"> |
| 50 | ${row.map(button => { |
| 51 | const entityState = this.hass.states[button.entityId] || {} |
| 52 | const icon = this._getCurrentIcon(button, entityState) |
| 53 | const style = this._getCurrentStyle(button, entityState) |
| 54 | const iconStyle = this._getCurrentIconStyle(button, entityState) |
| 55 | const name = |
| 56 | button.name || (!icon && entityState.attributes ? entityState.attributes.friendly_name : null) |
| 57 | |
| 58 | return html` |
| 59 | <paper-button |
| 60 | @click="${() => this._handleButtonClick(button)}" |
| 61 | style="${style}" |
| 62 | class="${this._getCurrentClass(entityState)}" |
| 63 | > |
| 64 | ${icon && |
| 65 | html` |
| 66 | <ha-icon icon="${icon}" style="${iconStyle} ${name ? "padding-right: 5px;" : ""}"></ha-icon> |
| 67 | `} |
| 68 | ${name} |
| 69 | <paper-ripple center class="${name ? "" : "circle"}"></paper-ripple> |
| 70 | </paper-button> |
| 71 | ` |
| 72 | })} |
| 73 | </div> |
| 74 | ` |
| 75 | })} |
| 76 | ` |
| 77 | } |
| 78 | |
| 79 | setConfig(config) { |
| 80 | config = JSON.parse(JSON.stringify(config)) |
nothing calls this directly
no test coverage detected