1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 14:12:24 +01:00

fix: consolidate lamp names in log message for read_timers_to_log function

This commit is contained in:
Oliver Kleinecke
2025-02-19 13:33:40 +01:00
parent c5d92adee8
commit a75a9523c2

View File

@@ -304,13 +304,18 @@ std::vector<bool> DynamicLampComponent::build_lamp_list_from_list_str_(std::stri
void DynamicLampComponent::read_timers_to_log() {
DynamicLampTimer timer;
this->fram_->read((2048), reinterpret_cast<unsigned char *>(&timer), 24);
std::string lamp_names_str = "";
for (uint8_t j = 0; j < 16; j++) {
bool lamp_included = static_cast<bool>(timer.lamp_list[j / 8] & (1 << (j % 8)));
if (lamp_included && this->active_lamps_[j].active) {
ESP_LOGV(TAG, "Timer found for lamp %s [ active: %d, action: %d, hour: %d, minute: %d, monday: %d, tuesday: %d, wednesday: %d, thursday: %d, friday: %d, saturday: %d, sunday: %d ]",
this->active_lamps_[j].name.c_str(), timer.active, timer.action, timer.hour, timer.minute, timer.monday, timer.tuesday,
timer.wednesday, timer.thursday, timer.friday, timer.saturday, timer.sunday);
if (lamp_names_str.length() > 0) {
lamp_names_str += ", ";
}
lamp_names_str += this->active_lamps_[j].name;
}
ESP_LOGV(TAG, "Timer found for lamps [%s]: [ active: %d, action: %d, hour: %d, minute: %d, monday: %d, tuesday: %d, wednesday: %d, thursday: %d, friday: %d, saturday: %d, sunday: %d ]",
lamp_names_str.c_str(), timer.active, timer.action, timer.hour, timer.minute, timer.monday, timer.tuesday,
timer.wednesday, timer.thursday, timer.friday, timer.saturday, timer.sunday);
}
}