From 6e5ecf72ac832aead9ecd5b2d609540ed77b1d3a Mon Sep 17 00:00:00 2001 From: Alexander 'Leo' Bergolth Date: Thu, 27 Jun 2024 21:58:56 +0200 Subject: [PATCH] whitespace and clang-format cleanup --- esphome/components/web_server/list_entities.cpp | 12 +++++------- esphome/components/web_server/states.cpp | 2 +- esphome/components/web_server/states.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/esphome/components/web_server/list_entities.cpp b/esphome/components/web_server/list_entities.cpp index 0281db4653..d0c5b21351 100644 --- a/esphome/components/web_server/list_entities.cpp +++ b/esphome/components/web_server/list_entities.cpp @@ -15,8 +15,7 @@ ListEntitiesIterator::ListEntitiesIterator(WebServer *web_server) : web_server_( bool ListEntitiesIterator::on_binary_sensor(binary_sensor::BinarySensor *binary_sensor) { if (!this->has_connected_client()) return true; - return this->process( - this->web_server_->binary_sensor_json(binary_sensor, binary_sensor->state, DETAIL_ALL)); + return this->process(this->web_server_->binary_sensor_json(binary_sensor, binary_sensor->state, DETAIL_ALL)); } #endif #ifdef USE_COVER @@ -65,8 +64,7 @@ bool ListEntitiesIterator::on_button(button::Button *button) { bool ListEntitiesIterator::on_text_sensor(text_sensor::TextSensor *text_sensor) { 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)); } #endif #ifdef USE_LOCK @@ -145,8 +143,8 @@ bool ListEntitiesIterator::on_select(select::Select *select) { bool ListEntitiesIterator::on_alarm_control_panel(alarm_control_panel::AlarmControlPanel *a_alarm_control_panel) { if (!this->has_connected_client()) return true; - return this->process( - this->web_server_->alarm_control_panel_json(a_alarm_control_panel, a_alarm_control_panel->get_state(), DETAIL_ALL)); + return this->process(this->web_server_->alarm_control_panel_json(a_alarm_control_panel, + a_alarm_control_panel->get_state(), DETAIL_ALL)); } #endif @@ -155,7 +153,7 @@ bool ListEntitiesIterator::on_event(event::Event *event) { // Null event type, since we are just iterating over entities const std::string null_event_type = ""; if (!this->has_connected_client()) - return true; + return true; return this->process(this->web_server_->event_json(event, null_event_type, DETAIL_ALL)); } #endif diff --git a/esphome/components/web_server/states.cpp b/esphome/components/web_server/states.cpp index f832719c3e..c215b08e5b 100644 --- a/esphome/components/web_server/states.cpp +++ b/esphome/components/web_server/states.cpp @@ -9,7 +9,7 @@ namespace esphome { namespace web_server { StatesIterator::StatesIterator(WebServer *web_server) : ListEntitiesIterator::ListEntitiesIterator(web_server) {} - + bool StatesIterator::has_connected_client() { return true; } bool StatesIterator::process(const std::string &s) { diff --git a/esphome/components/web_server/states.h b/esphome/components/web_server/states.h index c0af733cc4..264a52e5b7 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 has_connected_client() override; bool process(const std::string &s) override; };