From 44157f1ceddc224c4c5eaf0b6abcd3795c1be930 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Oct 2025 07:16:40 -0700 Subject: [PATCH] tweak --- esphome/components/modbus_controller/select/modbus_select.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/modbus_controller/select/modbus_select.cpp b/esphome/components/modbus_controller/select/modbus_select.cpp index 674dd05e55..4d4b5a4ffc 100644 --- a/esphome/components/modbus_controller/select/modbus_select.cpp +++ b/esphome/components/modbus_controller/select/modbus_select.cpp @@ -28,7 +28,7 @@ void ModbusSelect::parse_and_publish(const std::vector &data) { if (map_it != this->mapping_.cend()) { size_t idx = std::distance(this->mapping_.cbegin(), map_it); - new_state = this->traits.get_options()[idx]; + new_state = std::string(this->traits.get_options()[idx]); ESP_LOGV(TAG, "Found option %s for value %lld", new_state->c_str(), value); } else { ESP_LOGE(TAG, "No option found for mapping %lld", value);