Add condition description for trigger condition (#13941)
This commit is contained in:
parent
4f4a95c04e
commit
176d8567f4
|
@ -36,6 +36,7 @@ const conditions = [
|
|||
{ condition: "sun", after: "sunset" },
|
||||
{ condition: "sun", after: "sunrise", offset: "-01:00" },
|
||||
{ condition: "zone", entity_id: "device_tracker.person", zone: "zone.home" },
|
||||
{ condition: "trigger", id: "motion" },
|
||||
{ condition: "time" },
|
||||
{ condition: "template" },
|
||||
];
|
||||
|
|
|
@ -572,6 +572,13 @@ export const describeCondition = (
|
|||
}`;
|
||||
}
|
||||
|
||||
if (condition.condition === "trigger") {
|
||||
if (!condition.id) {
|
||||
return "Trigger condition";
|
||||
}
|
||||
return `When triggered by ${condition.id}`;
|
||||
}
|
||||
|
||||
return `${
|
||||
condition.condition ? condition.condition.replace(/_/g, " ") : "Unknown"
|
||||
} condition`;
|
||||
|
|
Loading…
Reference in New Issue