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

refactor: remove unused string trimming methods from DynamicLamp

This commit is contained in:
Oliver Kleinecke
2025-02-15 13:48:52 +01:00
parent 24a5e95a66
commit 3e4e20cd52
2 changed files with 0 additions and 24 deletions

View File

@@ -180,26 +180,5 @@ void DynamicLamp::restore_lamp_values_(uint8_t lamp_number) {
this->active_lamps_[lamp_number].active = false;
}
std::string_view DynamicLamp::ltrim_(std::string_view str)
{
const auto pos(str.find_first_not_of(" \t\n\r\f\v"));
str.remove_prefix(std::min(pos, str.length()));
return str;
}
std::string_view DynamicLamp::rtrim_(std::string_view str)
{
const auto pos(str.find_last_not_of(" \t\n\r\f\v"));
str.remove_suffix(std::min(str.length() - pos - 1, str.length()));
return str;
}
std::string_view DynamicLamp::trim_(std::string_view str)
{
str = this->ltrim_(str);
str = this->rtrim_(str);
return str;
}
} // namespace dynamic_lamp
} // namespace esphome

View File

@@ -53,9 +53,6 @@ class DynamicLamp : public Component {
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);
std::string_view rtrim_(std::string_view str);
std::string_view trim_(std::string_view str);
CombinedLamp active_lamps_[16];
LinkedOutput available_outputs_[16];