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:
@@ -180,26 +180,5 @@ void DynamicLamp::restore_lamp_values_(uint8_t lamp_number) {
|
|||||||
this->active_lamps_[lamp_number].active = false;
|
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 dynamic_lamp
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
@@ -53,9 +53,6 @@ class DynamicLamp : public Component {
|
|||||||
void add_lamp_output_(std::string lamp_name, LinkedOutput &output);
|
void add_lamp_output_(std::string lamp_name, LinkedOutput &output);
|
||||||
void restore_lamp_values_(uint8_t lamp_number);
|
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);
|
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];
|
CombinedLamp active_lamps_[16];
|
||||||
LinkedOutput available_outputs_[16];
|
LinkedOutput available_outputs_[16];
|
||||||
|
Reference in New Issue
Block a user