mirror of
https://github.com/home-assistant/frontend.git
synced 2025-05-02 01:07:20 +00:00
Change words for trigger condition (#11733)
This commit is contained in:
parent
728c391b5d
commit
6e4b027575
@ -18,7 +18,7 @@ export class HaTriggerCondition extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public condition!: TriggerCondition;
|
@property({ attribute: false }) public condition!: TriggerCondition;
|
||||||
|
|
||||||
@state() private _triggers?: Trigger | Trigger[];
|
@state() private _triggers: Trigger[] = [];
|
||||||
|
|
||||||
private _unsub?: UnsubscribeFunc;
|
private _unsub?: UnsubscribeFunc;
|
||||||
|
|
||||||
@ -44,7 +44,8 @@ export class HaTriggerCondition extends LitElement {
|
|||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
const { id } = this.condition;
|
const { id } = this.condition;
|
||||||
if (!this._triggers) {
|
|
||||||
|
if (!this._triggers.length) {
|
||||||
return this.hass.localize(
|
return this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.conditions.type.trigger.no_triggers"
|
"ui.panel.config.automation.editor.conditions.type.trigger.no_triggers"
|
||||||
);
|
);
|
||||||
@ -56,20 +57,19 @@ export class HaTriggerCondition extends LitElement {
|
|||||||
.value=${id}
|
.value=${id}
|
||||||
@selected=${this._triggerPicked}
|
@selected=${this._triggerPicked}
|
||||||
>
|
>
|
||||||
${ensureArray(this._triggers).map((trigger) =>
|
${this._triggers.map(
|
||||||
trigger.id
|
(trigger) =>
|
||||||
? html`
|
html`
|
||||||
<mwc-list-item .value=${trigger.id}>
|
<mwc-list-item .value=${trigger.id}> ${trigger.id} </mwc-list-item>
|
||||||
${trigger.id}
|
|
||||||
</mwc-list-item>
|
|
||||||
`
|
`
|
||||||
: ""
|
|
||||||
)}
|
)}
|
||||||
</mwc-select>`;
|
</mwc-select>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _automationUpdated(config?: AutomationConfig) {
|
private _automationUpdated(config?: AutomationConfig) {
|
||||||
this._triggers = config?.trigger;
|
this._triggers = config?.trigger
|
||||||
|
? ensureArray(config.trigger).filter((t) => t.id)
|
||||||
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private _triggerPicked(ev) {
|
private _triggerPicked(ev) {
|
||||||
|
@ -1799,9 +1799,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"trigger": {
|
"trigger": {
|
||||||
"label": "Trigger",
|
"label": "Triggered by",
|
||||||
"no_triggers": "No triggers available",
|
"no_triggers": "No triggers have an ID set. You can set an ID using the trigger menu button.",
|
||||||
"id": "Trigger ID"
|
"id": "Trigger"
|
||||||
},
|
},
|
||||||
"zone": {
|
"zone": {
|
||||||
"label": "[%key:ui::panel::config::automation::editor::triggers::type::zone::label%]",
|
"label": "[%key:ui::panel::config::automation::editor::triggers::type::zone::label%]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user