Fix failed conditions reason (#8870)

This commit is contained in:
Paulus Schoutsen 2021-04-08 23:01:12 -07:00 committed by Bram Kragten
parent 7c823c98ae
commit d7c0c2ea72
No known key found for this signature in database
GPG Key ID: FBE2DFDB363EF55B
3 changed files with 4 additions and 5 deletions

View File

@ -17,7 +17,7 @@ import { DemoTrace } from "../data/traces/types";
const traces: DemoTrace[] = [ const traces: DemoTrace[] = [
mockDemoTrace({ state: "running" }), mockDemoTrace({ state: "running" }),
mockDemoTrace({ state: "debugged" }), mockDemoTrace({ state: "debugged" }),
mockDemoTrace({ state: "stopped", script_execution: "failed_condition" }), mockDemoTrace({ state: "stopped", script_execution: "failed_conditions" }),
mockDemoTrace({ state: "stopped", script_execution: "failed_single" }), mockDemoTrace({ state: "stopped", script_execution: "failed_single" }),
mockDemoTrace({ state: "stopped", script_execution: "failed_max_runs" }), mockDemoTrace({ state: "stopped", script_execution: "failed_max_runs" }),
mockDemoTrace({ state: "stopped", script_execution: "finished" }), mockDemoTrace({ state: "stopped", script_execution: "finished" }),

View File

@ -475,7 +475,7 @@ export class HaAutomationTracer extends LitElement {
let extra: TemplateResult | undefined; let extra: TemplateResult | undefined;
switch (this.trace.script_execution) { switch (this.trace.script_execution) {
case "failed_condition": case "failed_conditions":
reason = "a condition failed"; reason = "a condition failed";
break; break;
case "failed_single": case "failed_single":

View File

@ -66,7 +66,7 @@ export interface AutomationTrace {
}; };
script_execution: script_execution:
| // The script was not executed because the automation's condition failed | // The script was not executed because the automation's condition failed
"failed_condition" "failed_conditions"
// The script was not executed because the run mode is single // The script was not executed because the run mode is single
| "failed_single" | "failed_single"
// The script was not executed because max parallel runs would be exceeded // The script was not executed because max parallel runs would be exceeded
@ -80,8 +80,7 @@ export interface AutomationTrace {
| "error" | "error"
// The exception is in the trace itself or in the last element of the trace // The exception is in the trace itself or in the last element of the trace
// Script execution stopped by async_stop called on the script run because home assistant is shutting down, script mode is SCRIPT_MODE_RESTART etc: // Script execution stopped by async_stop called on the script run because home assistant is shutting down, script mode is SCRIPT_MODE_RESTART etc:
| "cancelled" | "cancelled";
| string;
// Automation only, should become it's own type when we support script in frontend // Automation only, should become it's own type when we support script in frontend
trigger: string; trigger: string;
} }