remove duplicate controls blueprint automation (#13554)

This commit is contained in:
Bram Kragten 2022-09-01 17:37:22 +02:00 committed by GitHub
parent d661450121
commit 2751adf440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ import { HassEntity } from "home-assistant-js-websocket";
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event";
import "../../../components/entity/ha-entity-toggle";
import "../../../components/ha-blueprint-picker";
import "../../../components/ha-card";
import "../../../components/ha-circular-progress";
@ -11,10 +10,7 @@ import "../../../components/ha-markdown";
import "../../../components/ha-selector/ha-selector";
import "../../../components/ha-settings-row";
import "../../../components/ha-textfield";
import {
BlueprintAutomationConfig,
triggerAutomationActions,
} from "../../../data/automation";
import { BlueprintAutomationConfig } from "../../../data/automation";
import {
BlueprintOrError,
Blueprints,
@ -67,9 +63,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
const blueprint = this._blueprint;
return html`
<ha-config-section vertical .isWide=${this.isWide}>
${!this.narrow
? html` <span slot="header">${this.config.alias}</span> `
: ""}
<span slot="introduction">
${this.hass.localize(
"ui.panel.config.automation.editor.introduction"
@ -102,36 +95,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
</div>
`}
</div>
${this.stateObj
? html`
<div class="card-actions layout horizontal justified center">
<div class="layout horizontal center">
<ha-entity-toggle
.hass=${this.hass}
.stateObj=${this.stateObj!}
></ha-entity-toggle>
${this.hass.localize(
"ui.panel.config.automation.editor.enable_disable"
)}
</div>
<div>
<a href="/config/automation/trace/${this.config.id}">
<mwc-button>
${this.hass.localize(
"ui.panel.config.automation.editor.show_trace"
)}
</mwc-button>
</a>
<mwc-button
@click=${this._runActions}
.stateObj=${this.stateObj}
>
${this.hass.localize("ui.card.automation.trigger")}
</mwc-button>
</div>
</div>
`
: ""}
</ha-card>
</ha-config-section>
@ -220,10 +183,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
this._blueprints = await fetchBlueprints(this.hass, "automation");
}
private _runActions(ev: Event) {
triggerAutomationActions(this.hass, (ev.target as any).stateObj.entity_id);
}
private _blueprintChanged(ev) {
ev.stopPropagation();
if (this.config.use_blueprint.path === ev.detail.value) {
@ -319,9 +278,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
p {
margin-bottom: 0;
}
ha-entity-toggle {
margin-right: 8px;
}
ha-settings-row {
--paper-time-input-justify-content: flex-end;
--settings-row-content-width: 100%;