Use "limit" instead of "mode" for Numeric state trigger and condition (#23360)

This commit is contained in:
Norbert Rittel 2024-12-22 17:00:48 +01:00 committed by GitHub
parent 5cd6f22e99
commit 8b6382448f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 20 deletions

View File

@ -67,8 +67,8 @@ export default class HaNumericStateCondition extends LitElement {
inputBelowIsEntity: boolean, inputBelowIsEntity: boolean,
condition: NumericStateCondition condition: NumericStateCondition
) => ({ ) => ({
mode_above: inputAboveIsEntity ? "input" : "value", lower_limit: inputAboveIsEntity ? "input" : "value",
mode_below: inputBelowIsEntity ? "input" : "value", upper_limit: inputBelowIsEntity ? "input" : "value",
...condition, ...condition,
}) })
); );
@ -158,7 +158,7 @@ export default class HaNumericStateCondition extends LitElement {
}, },
}, },
{ {
name: "mode_above", name: "lower_limit",
type: "select", type: "select",
required: true, required: true,
options: [ options: [
@ -199,7 +199,7 @@ export default class HaNumericStateCondition extends LitElement {
}, },
] as const)), ] as const)),
{ {
name: "mode_below", name: "upper_limit",
type: "select", type: "select",
required: true, required: true,
options: [ options: [
@ -290,11 +290,11 @@ export default class HaNumericStateCondition extends LitElement {
ev.stopPropagation(); ev.stopPropagation();
const newCondition = { ...ev.detail.value }; const newCondition = { ...ev.detail.value };
this._inputAboveIsEntity = newCondition.mode_above === "input"; this._inputAboveIsEntity = newCondition.lower_limit === "input";
this._inputBelowIsEntity = newCondition.mode_below === "input"; this._inputBelowIsEntity = newCondition.upper_limit === "input";
delete newCondition.mode_above; delete newCondition.lower_limit;
delete newCondition.mode_below; delete newCondition.upper_limit;
if (newCondition.value_template === "") { if (newCondition.value_template === "") {
delete newCondition.value_template; delete newCondition.value_template;

View File

@ -135,7 +135,7 @@ export class HaNumericStateTrigger extends LitElement {
}, },
}, },
{ {
name: "mode_above", name: "lower_limit",
type: "select", type: "select",
required: true, required: true,
options: [ options: [
@ -176,7 +176,7 @@ export class HaNumericStateTrigger extends LitElement {
}, },
] as const)), ] as const)),
{ {
name: "mode_below", name: "upper_limit",
type: "select", type: "select",
required: true, required: true,
options: [ options: [
@ -264,8 +264,8 @@ export class HaNumericStateTrigger extends LitElement {
inputBelowIsEntity: boolean, inputBelowIsEntity: boolean,
trigger: NumericStateTrigger trigger: NumericStateTrigger
) => ({ ) => ({
mode_above: inputAboveIsEntity ? "input" : "value", lower_limit: inputAboveIsEntity ? "input" : "value",
mode_below: inputBelowIsEntity ? "input" : "value", upper_limit: inputBelowIsEntity ? "input" : "value",
...trigger, ...trigger,
entity_id: ensureArray(trigger.entity_id), entity_id: ensureArray(trigger.entity_id),
for: createDurationData(trigger.for), for: createDurationData(trigger.for),
@ -302,11 +302,11 @@ export class HaNumericStateTrigger extends LitElement {
ev.stopPropagation(); ev.stopPropagation();
const newTrigger = { ...ev.detail.value }; const newTrigger = { ...ev.detail.value };
this._inputAboveIsEntity = newTrigger.mode_above === "input"; this._inputAboveIsEntity = newTrigger.lower_limit === "input";
this._inputBelowIsEntity = newTrigger.mode_below === "input"; this._inputBelowIsEntity = newTrigger.upper_limit === "input";
delete newTrigger.mode_above; delete newTrigger.lower_limit;
delete newTrigger.mode_below; delete newTrigger.upper_limit;
if (newTrigger.value_template === "") { if (newTrigger.value_template === "") {
delete newTrigger.value_template; delete newTrigger.value_template;

View File

@ -3177,8 +3177,8 @@
"label": "Numeric state", "label": "Numeric state",
"above": "Above", "above": "Above",
"below": "Below", "below": "Below",
"mode_above": "Above mode", "lower_limit": "Lower limit",
"mode_below": "Below mode", "upper_limit": "Upper limit",
"value_template": "Value template", "value_template": "Value template",
"type_value": "Fixed number", "type_value": "Fixed number",
"type_input": "Numeric value of another entity", "type_input": "Numeric value of another entity",
@ -3380,8 +3380,8 @@
"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%]",
"below": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::below%]", "below": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::below%]",
"mode_above": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::mode_above%]", "lower_limit": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::lower_limit%]",
"mode_below": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::mode_below%]", "upper_limit": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::upper_limit%]",
"value_template": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::value_template%]", "value_template": "[%key:ui::panel::config::automation::editor::triggers::type::numeric_state::value_template%]",
"description": { "description": {
"picker": "If the numeric value of an entity''s state (or attribute''s value) is above or below a given threshold.", "picker": "If the numeric value of an entity''s state (or attribute''s value) is above or below a given threshold.",