From 5fb2e3316a6c9d99bc99bf3d90b9ecef07da8de4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 22 Aug 2022 18:16:11 +0200 Subject: [PATCH] Use number selector for above & below in numeric trigger/condition (#13422) --- .../ha-automation-condition-numeric_state.ts | 24 +++++++++++++++++-- .../ha-automation-trigger-numeric_state.ts | 24 +++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts index 5b76d3008a..9a8d3f0a32 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts @@ -95,8 +95,28 @@ export default class HaNumericStateCondition extends LitElement { }, }, }, - { name: "above", selector: { text: {} } }, - { name: "below", selector: { text: {} } }, + { + name: "above", + selector: { + number: { + mode: "box", + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER, + step: 0.1, + }, + }, + }, + { + name: "below", + selector: { + number: { + mode: "box", + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER, + step: 0.1, + }, + }, + }, { name: "value_template", selector: { template: {} }, diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts index e49cfbcd39..f7a8540a8b 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts @@ -91,8 +91,28 @@ export class HaNumericStateTrigger extends LitElement { }, }, }, - { name: "above", selector: { text: {} } }, - { name: "below", selector: { text: {} } }, + { + name: "above", + selector: { + number: { + mode: "box", + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER, + step: 0.1, + }, + }, + }, + { + name: "below", + selector: { + number: { + mode: "box", + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER, + step: 0.1, + }, + }, + }, { name: "value_template", selector: { template: {} },