1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-09 23:02:23 +01:00

test commit for separating string by comma

This commit is contained in:
Oliver Kleinecke
2025-02-14 14:21:52 +01:00
parent c7db36b503
commit 4bd04442a0
2 changed files with 15 additions and 8 deletions

View File

@@ -77,13 +77,21 @@ void DynamicLamp::set_save_mode(uint8_t save_mode) {
this->save_mode_ = save_mode;
}
void DynamicLamp::set_available_outputs(std::list<std::string> output_list) {
uint8_t i = 0;
for (std::list<std::string>::iterator it = output_list.begin(); it != output_list.end(); ++it) {
this->available_outputs_[i] = *it;
i++;
void DynamicLamp::set_available_outputs(std::string output_list) {
int counter = 0;
std::vector<std::string> v;
char * token = strtok (&output_list[0],",");
while (token != NULL)
{
v.push_back(token);
token = strtok (NULL, ",");
}
for ( std::string s : v )
{
this->available_outputs_[counter] = s.c_str();
counter++;
}
}
void DynamicLamp::set_lamp_count(uint8_t lamp_count) {