1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

fix: change token type in split_to_int_vector_ from string to uint8_t for improved type safety

This commit is contained in:
Oliver Kleinecke 2025-02-19 11:15:07 +01:00
parent 6fb093aa1d
commit f51f5cd70b

View File

@ -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));