From 6c853cae57e481893c24e6ced566f0597847b553 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 2 Feb 2026 02:40:45 +0100 Subject: [PATCH] use pattern from sensor filters --- esphome/components/template/select/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/template/select/__init__.py b/esphome/components/template/select/__init__.py index 8de7bce83d..08c7c07132 100644 --- a/esphome/components/template/select/__init__.py +++ b/esphome/components/template/select/__init__.py @@ -66,11 +66,10 @@ CONFIG_SCHEMA = cv.All( async def to_code(config): # Use subclass with trigger only when set_action is configured - select_id = config[CONF_ID] if CONF_SET_ACTION in config: - select_id = select_id.copy() - select_id.type = TemplateSelectWithSetAction - var = cg.new_Pvariable(select_id) + config[CONF_ID] = config[CONF_ID].copy() + config[CONF_ID].type = TemplateSelectWithSetAction + var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) await select.register_select(var, config, options=config[CONF_OPTIONS])