diff --git a/esphome/components/web_server/list_entities.cpp b/esphome/components/web_server/list_entities.cpp index e20d6200be..0281db4653 100644 --- a/esphome/components/web_server/list_entities.cpp +++ b/esphome/components/web_server/list_entities.cpp @@ -63,14 +63,10 @@ bool ListEntitiesIterator::on_button(button::Button *button) { #endif #ifdef USE_TEXT_SENSOR bool ListEntitiesIterator::on_text_sensor(text_sensor::TextSensor *text_sensor) { -<<<<<<< HEAD if (!this->has_connected_client()) return true; return this->process( this->web_server_->text_sensor_json(text_sensor, text_sensor->state, DETAIL_ALL)); -======= - return this->process(this->web_server_->text_sensor_json(text_sensor, text_sensor->state, DETAIL_ALL)); ->>>>>>> 4d9a3ae3c (make lint checker happier) } #endif #ifdef USE_LOCK @@ -174,7 +170,7 @@ bool ListEntitiesIterator::on_update(update::UpdateEntity *update) { bool ListEntitiesIterator::has_connected_client() { return this->web_server_->events_.count() > 0; } -bool ListEntitiesIterator::process(std::string s) { +bool ListEntitiesIterator::process(const std::string &s) { this->web_server_->events_.send(s.c_str(), "state"); return true; } diff --git a/esphome/components/web_server/list_entities.h b/esphome/components/web_server/list_entities.h index f987609359..50ab0a38a2 100644 --- a/esphome/components/web_server/list_entities.h +++ b/esphome/components/web_server/list_entities.h @@ -75,8 +75,8 @@ class ListEntitiesIterator : public ComponentIterator { protected: WebServer *web_server_; - bool has_connected_client(); - virtual bool process(std::string s); + virtual bool has_connected_client(); + virtual bool process(const std::string &s); }; } // namespace web_server diff --git a/esphome/components/web_server/states.cpp b/esphome/components/web_server/states.cpp index 303f0ae01d..f832719c3e 100644 --- a/esphome/components/web_server/states.cpp +++ b/esphome/components/web_server/states.cpp @@ -12,7 +12,7 @@ StatesIterator::StatesIterator(WebServer *web_server) : ListEntitiesIterator::Li bool StatesIterator::has_connected_client() { return true; } -bool StatesIterator::process(std::string s) { +bool StatesIterator::process(const std::string &s) { this->str_ = s; return true; } diff --git a/esphome/components/web_server/states.h b/esphome/components/web_server/states.h index 77289a7f22..044d6a6f4a 100644 --- a/esphome/components/web_server/states.h +++ b/esphome/components/web_server/states.h @@ -21,7 +21,7 @@ class StatesIterator : public ListEntitiesIterator { protected: // WebServer *web_server_; optional str_; - bool process(std::string s) override; + bool process(const std::string &s) override; }; } // namespace web_server