From 16130308f908d6a41c39a4669f68a73edee89077 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 25 Oct 2025 10:26:53 -0700 Subject: [PATCH] touch ups --- esphome/components/template/select/template_select.cpp | 4 +--- tests/integration/test_host_mode_empty_string_options.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/template/select/template_select.cpp b/esphome/components/template/select/template_select.cpp index a07215e77e..3765cf02bf 100644 --- a/esphome/components/template/select/template_select.cpp +++ b/esphome/components/template/select/template_select.cpp @@ -60,13 +60,11 @@ void TemplateSelect::dump_config() { LOG_UPDATE_INTERVAL(this); if (this->f_.has_value()) return; - auto initial_option = this->at(this->initial_option_index_); ESP_LOGCONFIG(TAG, " Optimistic: %s\n" " Initial Option: %s\n" " Restore Value: %s", - YESNO(this->optimistic_), - initial_option.has_value() ? initial_option.value().c_str() : LOG_STR_LITERAL("unknown"), + YESNO(this->optimistic_), this->at(this->initial_option_index_).value().c_str(), YESNO(this->restore_value_)); } diff --git a/tests/integration/test_host_mode_empty_string_options.py b/tests/integration/test_host_mode_empty_string_options.py index 1316e43a9f..1180ce75fc 100644 --- a/tests/integration/test_host_mode_empty_string_options.py +++ b/tests/integration/test_host_mode_empty_string_options.py @@ -129,7 +129,7 @@ async def test_host_mode_empty_string_options( initial_state = states[initial_option_test.key] assert initial_state.state == "Third", ( f"Expected initial state 'Third' but got '{initial_state.state}' - " - f"initial_option_index optimization may not be working correctly" + f"initial_option not correctly applied" ) # The main test is that we got here without protobuf errors