${config.icon ? html`
` : ''}
@@ -165,7 +164,7 @@ class ButtonCard extends LitElement {
text-align: center;
}
-
+ this._toggle(state, config)}">
${config.icon ? html`` : ''}
@@ -181,8 +180,9 @@ class ButtonCard extends LitElement {
// if (!config.entity) {
// throw new Error('You need to define entity');
// }
- this.config = {...config};
+ this.config = config;
this.config.color = config.color ? config.color : 'var(--primary-text-color)';
+ this.config.state = config.state;
this.config.size = config.size ? config.size : '40%';
let cardStyle = '';
if (config.style) {