Fix activate scene button + allow removing icon (#8916)

This commit is contained in:
Bram Kragten 2021-04-15 13:02:09 +02:00 committed by GitHub
parent f6e223c18d
commit 8e11aa9130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -228,7 +228,7 @@ class HaSceneDashboard extends LitElement {
private async _activateScene(ev) {
ev.stopPropagation();
const scene = ev.target.scene as SceneEntity;
const scene = ev.currentTarget.scene as SceneEntity;
await activateScene(this.hass, scene.entity_id);
showToast(this, {
message: this.hass.localize(

View File

@ -629,7 +629,12 @@ export class HaSceneEditor extends SubscribeMixin(
if ((this._config![name] || "") === newVal) {
return;
}
if (!newVal) {
delete this._config![name];
this._config = { ...this._config! };
} else {
this._config = { ...this._config!, [name]: newVal };
}
this._dirty = true;
}