1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 11:42:20 +01:00

feat: add logging for lamp addition and removal in DynamicLampComponent

This commit is contained in:
Oliver Kleinecke
2025-02-17 15:36:50 +01:00
parent e5159321e9
commit 22a52314c9

View File

@@ -149,6 +149,7 @@ void DynamicLampComponent::add_lamp(std::string name) {
this->active_lamps_[this->lamp_count_].used_outputs[i] = false;
}
this->lamp_count_++;
ESP_LOGV(TAG, "Added new lamp %s, total lamps now %" PRIu8 "", name.c_str(), this->lamp_count_);
return;
}
ESP_LOGW(TAG, "No more lamps available, max 16 lamps supported!");
@@ -164,6 +165,8 @@ void DynamicLampComponent::remove_lamp(std::string lamp_name) {
this->available_outputs_[j].in_use = false;
}
this->active_lamps_[i].active = false;
this->lamp_count_--;
ESP_LOGV(TAG, "Removed lamp %s, total lamps now %" PRIu8 "", name.c_str(), this->lamp_count_);
return;
}
}