From 612ee821832b1a2db985219896033c0af134d501 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Wed, 19 Feb 2025 22:52:34 +0100 Subject: [PATCH] fix: update lamp name handling in read_fram_timers_to_log function of DynamicLampComponent --- esphome/components/dynamic_lamp/dynamic_lamp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/dynamic_lamp/dynamic_lamp.cpp b/esphome/components/dynamic_lamp/dynamic_lamp.cpp index 33894107a1..15b9e8ef10 100644 --- a/esphome/components/dynamic_lamp/dynamic_lamp.cpp +++ b/esphome/components/dynamic_lamp/dynamic_lamp.cpp @@ -362,7 +362,8 @@ void DynamicLampComponent::read_fram_timers_to_log() { if (lamp_names_str.length() > 0) { lamp_names_str += ", "; } - lamp_names_str += this->active_lamps_[j].name; + std::string str(this->active_lamps_[j].name, this->active_lamps_[j].name + sizeof this->active_lamps_[j].name / sizeof this->active_lamps_[j].name[0]); + lamp_names_str += str; } } ESP_LOGV(TAG, "Timer %s found: [ active: %d, action: %d, hour: %d, minute: %d, monday: %d, tuesday: %d, wednesday: %d, thursday: %d, friday: %d, saturday: %d, sunday: %d ]",