From 7fd08fb8163206534ca94251669b1cdc7f2cc655 Mon Sep 17 00:00:00 2001 From: Fabio Pugliese Ornellas Date: Tue, 5 Dec 2023 04:17:43 +0000 Subject: [PATCH] Fix template text component length check (#5881) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: Keith Burzinski --- esphome/components/template/text/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/template/text/__init__.py b/esphome/components/template/text/__init__.py index a82664ee15..0f228a3c6b 100644 --- a/esphome/components/template/text/__init__.py +++ b/esphome/components/template/text/__init__.py @@ -39,8 +39,8 @@ def validate(config): ) with cv.prepend_path(CONF_MIN_LENGTH): - if config[CONF_MIN_LENGTH] >= config[CONF_MAX_LENGTH]: - raise cv.Invalid("min_length must be less than max_length") + if config[CONF_MIN_LENGTH] > config[CONF_MAX_LENGTH]: + raise cv.Invalid("min_length must be less than or equal to max_length") return config