mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36:36 +00:00
Add NOT condition helper (#5616)
This commit is contained in:
parent
b0c27e587e
commit
2084ecc4c6
@ -120,7 +120,7 @@ export type Trigger =
|
|||||||
| DeviceTrigger;
|
| DeviceTrigger;
|
||||||
|
|
||||||
export interface LogicalCondition {
|
export interface LogicalCondition {
|
||||||
condition: "and" | "or";
|
condition: "and" | "not" | "or";
|
||||||
conditions: Condition[];
|
conditions: Condition[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import type { HomeAssistant } from "../../../../types";
|
|||||||
import "../../../../components/ha-yaml-editor";
|
import "../../../../components/ha-yaml-editor";
|
||||||
import "./types/ha-automation-condition-and";
|
import "./types/ha-automation-condition-and";
|
||||||
import "./types/ha-automation-condition-device";
|
import "./types/ha-automation-condition-device";
|
||||||
|
import "./types/ha-automation-condition-not";
|
||||||
import "./types/ha-automation-condition-numeric_state";
|
import "./types/ha-automation-condition-numeric_state";
|
||||||
import "./types/ha-automation-condition-or";
|
import "./types/ha-automation-condition-or";
|
||||||
import "./types/ha-automation-condition-state";
|
import "./types/ha-automation-condition-state";
|
||||||
@ -23,6 +24,7 @@ const OPTIONS = [
|
|||||||
"device",
|
"device",
|
||||||
"and",
|
"and",
|
||||||
"or",
|
"or",
|
||||||
|
"not",
|
||||||
"state",
|
"state",
|
||||||
"numeric_state",
|
"numeric_state",
|
||||||
"sun",
|
"sun",
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
import { customElement } from "lit-element";
|
||||||
|
import { HaLogicalCondition } from "./ha-automation-condition-logical";
|
||||||
|
|
||||||
|
@customElement("ha-automation-condition-not")
|
||||||
|
export class HaNotCondition extends HaLogicalCondition {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"ha-automation-condition-not": HaNotCondition;
|
||||||
|
}
|
||||||
|
}
|
@ -868,6 +868,9 @@
|
|||||||
"for": "Duration"
|
"for": "Duration"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"not": {
|
||||||
|
"label": "Not"
|
||||||
|
},
|
||||||
"numeric_state": {
|
"numeric_state": {
|
||||||
"label": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::label%]",
|
"label": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::label%]",
|
||||||
"above": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::above%]",
|
"above": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::above%]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user