mirror of
https://github.com/esphome/esphome.git
synced 2025-09-25 06:32:22 +01:00
fix: change token type in split_to_int_vector_ from string to uint8_t for improved type safety
This commit is contained in:
@@ -340,7 +340,7 @@ void DynamicLampComponent::restore_lamp_values_(uint8_t lamp_number) {
|
||||
std::vector<uint8_t> DynamicLampComponent::split_to_int_vector_(const std::string& s, const std::string& delimiter) {
|
||||
std::vector<uint8_t> tokens;
|
||||
size_t pos = 0;
|
||||
std::string token;
|
||||
uint8_t token;
|
||||
while ((pos = s.find(delimiter)) != std::string::npos) {
|
||||
c_substr = s.substr(0, pos).c_str();
|
||||
token = static_cast<uint8_t>(atoi(c_substr));
|
||||
|
Reference in New Issue
Block a user