mirror of
https://github.com/esphome/esphome.git
synced 2025-09-09 14:52:20 +01:00
fix: add lamp index to active lamps in DynamicLamp management
This commit is contained in:
@@ -115,6 +115,7 @@ void DynamicLamp::add_lamp_(std::string name) {
|
||||
this->lamp_count_++;
|
||||
this->active_lamps_[this->lamp_count_].active = true;
|
||||
this->active_lamps_[this->lamp_count_].name = name;
|
||||
this->active_lamps_[this->lamp_count_].lamp_index = this->lamp_count_;
|
||||
return;
|
||||
}
|
||||
ESP_LOGW(TAG, "No more lamps available, max 16 lamps supported!");
|
||||
|
@@ -33,6 +33,7 @@ struct LinkedOutput {
|
||||
struct CombinedLamp {
|
||||
bool active = false;
|
||||
std::string name = "";
|
||||
uint8_t lamp_index;
|
||||
bool used_outputs[16];
|
||||
};
|
||||
|
||||
@@ -48,7 +49,7 @@ class DynamicLamp : public Component {
|
||||
void begin();
|
||||
void add_lamp_(std::string name);
|
||||
std::array<bool, 16> get_lamp_outputs_(uint8_t lamp_number);
|
||||
void add_lamp_output_(uint8_t lamp_number, LinkedOutput output);
|
||||
void add_lamp_output_(std::string lamp_name, LinkedOutput output);
|
||||
void restore_lamp_values_(uint8_t lamp_number);
|
||||
void set_lamp_values_(uint8_t lamp_number, bool active, uint16_t selected_outputs, uint8_t mode, uint8_t mode_value);
|
||||
std::string_view ltrim_(std::string_view str);
|
||||
|
Reference in New Issue
Block a user