mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
remove duplicate controls blueprint automation (#13554)
This commit is contained in:
parent
d661450121
commit
2751adf440
@ -3,7 +3,6 @@ import { HassEntity } from "home-assistant-js-websocket";
|
|||||||
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
|
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import "../../../components/entity/ha-entity-toggle";
|
|
||||||
import "../../../components/ha-blueprint-picker";
|
import "../../../components/ha-blueprint-picker";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
import "../../../components/ha-circular-progress";
|
import "../../../components/ha-circular-progress";
|
||||||
@ -11,10 +10,7 @@ import "../../../components/ha-markdown";
|
|||||||
import "../../../components/ha-selector/ha-selector";
|
import "../../../components/ha-selector/ha-selector";
|
||||||
import "../../../components/ha-settings-row";
|
import "../../../components/ha-settings-row";
|
||||||
import "../../../components/ha-textfield";
|
import "../../../components/ha-textfield";
|
||||||
import {
|
import { BlueprintAutomationConfig } from "../../../data/automation";
|
||||||
BlueprintAutomationConfig,
|
|
||||||
triggerAutomationActions,
|
|
||||||
} from "../../../data/automation";
|
|
||||||
import {
|
import {
|
||||||
BlueprintOrError,
|
BlueprintOrError,
|
||||||
Blueprints,
|
Blueprints,
|
||||||
@ -67,9 +63,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
const blueprint = this._blueprint;
|
const blueprint = this._blueprint;
|
||||||
return html`
|
return html`
|
||||||
<ha-config-section vertical .isWide=${this.isWide}>
|
<ha-config-section vertical .isWide=${this.isWide}>
|
||||||
${!this.narrow
|
|
||||||
? html` <span slot="header">${this.config.alias}</span> `
|
|
||||||
: ""}
|
|
||||||
<span slot="introduction">
|
<span slot="introduction">
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.introduction"
|
"ui.panel.config.automation.editor.introduction"
|
||||||
@ -102,36 +95,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
</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-card>
|
||||||
</ha-config-section>
|
</ha-config-section>
|
||||||
|
|
||||||
@ -220,10 +183,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
this._blueprints = await fetchBlueprints(this.hass, "automation");
|
this._blueprints = await fetchBlueprints(this.hass, "automation");
|
||||||
}
|
}
|
||||||
|
|
||||||
private _runActions(ev: Event) {
|
|
||||||
triggerAutomationActions(this.hass, (ev.target as any).stateObj.entity_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _blueprintChanged(ev) {
|
private _blueprintChanged(ev) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
if (this.config.use_blueprint.path === ev.detail.value) {
|
if (this.config.use_blueprint.path === ev.detail.value) {
|
||||||
@ -319,9 +278,6 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
ha-entity-toggle {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
ha-settings-row {
|
ha-settings-row {
|
||||||
--paper-time-input-justify-content: flex-end;
|
--paper-time-input-justify-content: flex-end;
|
||||||
--settings-row-content-width: 100%;
|
--settings-row-content-width: 100%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user