From eedabbfbb92f8b91dec42f98bd30fa951e97f81f Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Mon, 12 Feb 2024 01:43:14 +0100 Subject: [PATCH] fix clang-format --- esphome/components/ota/ota_component.h | 8 ++++---- esphome/components/ota_mcuboot/ota_component.h | 7 +++---- esphome/components/ota_network/ota_backend.h | 2 +- .../components/ota_network/ota_backend_arduino_esp32.cpp | 2 +- .../components/ota_network/ota_backend_arduino_esp32.h | 2 +- .../ota_network/ota_backend_arduino_esp8266.cpp | 2 +- .../components/ota_network/ota_backend_arduino_esp8266.h | 2 +- .../ota_network/ota_backend_arduino_libretiny.cpp | 2 +- .../ota_network/ota_backend_arduino_libretiny.h | 2 +- .../components/ota_network/ota_backend_arduino_rp2040.cpp | 2 +- .../components/ota_network/ota_backend_arduino_rp2040.h | 2 +- esphome/components/ota_network/ota_backend_esp_idf.cpp | 2 +- esphome/components/ota_network/ota_backend_esp_idf.h | 2 +- esphome/components/ota_network/ota_component.cpp | 2 +- esphome/components/ota_network/ota_component.h | 2 +- 15 files changed, 20 insertions(+), 21 deletions(-) diff --git a/esphome/components/ota/ota_component.h b/esphome/components/ota/ota_component.h index cda16480cd..461a43717d 100644 --- a/esphome/components/ota/ota_component.h +++ b/esphome/components/ota/ota_component.h @@ -11,15 +11,15 @@ enum OTAState { OTA_COMPLETED = 0, OTA_STARTED, OTA_IN_PROGRESS, OTA_ERROR }; class OTAComponent : public Component { public: - virtual bool should_enter_safe_mode(uint8_t num_attempts, uint32_t enable_time){ return false;} + virtual bool should_enter_safe_mode(uint8_t num_attempts, uint32_t enable_time) { return false; } /// Set to true if the next startup will enter safe mode - virtual void set_safe_mode_pending(const bool &pending){} - virtual bool get_safe_mode_pending() {return false;} + virtual void set_safe_mode_pending(const bool &pending) {} + virtual bool get_safe_mode_pending() { return false; } #ifdef USE_OTA_STATE_CALLBACK void add_on_state_callback(std::function &&callback); #endif -protected: + protected: #ifdef USE_OTA_STATE_CALLBACK CallbackManager state_callback_{}; #endif diff --git a/esphome/components/ota_mcuboot/ota_component.h b/esphome/components/ota_mcuboot/ota_component.h index e09870bdeb..ca1e5d31e7 100644 --- a/esphome/components/ota_mcuboot/ota_component.h +++ b/esphome/components/ota_mcuboot/ota_component.h @@ -5,8 +5,7 @@ namespace esphome { namespace ota_mcuboot { -class OTAComponent : public ota::OTAComponent { -}; +class OTAComponent : public ota::OTAComponent {}; -} -} +} // namespace ota_mcuboot +} // namespace esphome diff --git a/esphome/components/ota_network/ota_backend.h b/esphome/components/ota_network/ota_backend.h index 0988955928..dbabf704fc 100644 --- a/esphome/components/ota_network/ota_backend.h +++ b/esphome/components/ota_network/ota_backend.h @@ -15,5 +15,5 @@ class OTABackend { virtual bool supports_compression() = 0; }; -} // namespace ota +} // namespace ota_network } // namespace esphome diff --git a/esphome/components/ota_network/ota_backend_arduino_esp32.cpp b/esphome/components/ota_network/ota_backend_arduino_esp32.cpp index 6c3e0531ee..e269c0b6c1 100644 --- a/esphome/components/ota_network/ota_backend_arduino_esp32.cpp +++ b/esphome/components/ota_network/ota_backend_arduino_esp32.cpp @@ -40,7 +40,7 @@ OTAResponseTypes ArduinoESP32OTABackend::end() { void ArduinoESP32OTABackend::abort() { Update.abort(); } -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_ESP32_FRAMEWORK_ARDUINO diff --git a/esphome/components/ota_network/ota_backend_arduino_esp32.h b/esphome/components/ota_network/ota_backend_arduino_esp32.h index 1b5b500a15..609891370b 100644 --- a/esphome/components/ota_network/ota_backend_arduino_esp32.h +++ b/esphome/components/ota_network/ota_backend_arduino_esp32.h @@ -18,7 +18,7 @@ class ArduinoESP32OTABackend : public OTABackend { bool supports_compression() override { return false; } }; -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_ESP32_FRAMEWORK_ARDUINO diff --git a/esphome/components/ota_network/ota_backend_arduino_esp8266.cpp b/esphome/components/ota_network/ota_backend_arduino_esp8266.cpp index 4e4dfcdeb9..048cc71da1 100644 --- a/esphome/components/ota_network/ota_backend_arduino_esp8266.cpp +++ b/esphome/components/ota_network/ota_backend_arduino_esp8266.cpp @@ -52,7 +52,7 @@ void ArduinoESP8266OTABackend::abort() { esp8266::preferences_prevent_write(false); } -} // namespace ota +} // namespace ota_network } // namespace esphome #endif diff --git a/esphome/components/ota_network/ota_backend_arduino_esp8266.h b/esphome/components/ota_network/ota_backend_arduino_esp8266.h index d638a53148..512e2a4de6 100644 --- a/esphome/components/ota_network/ota_backend_arduino_esp8266.h +++ b/esphome/components/ota_network/ota_backend_arduino_esp8266.h @@ -24,7 +24,7 @@ class ArduinoESP8266OTABackend : public OTABackend { #endif }; -} // namespace ota +} // namespace ota_network } // namespace esphome #endif diff --git a/esphome/components/ota_network/ota_backend_arduino_libretiny.cpp b/esphome/components/ota_network/ota_backend_arduino_libretiny.cpp index 82ff28893f..1fd534d814 100644 --- a/esphome/components/ota_network/ota_backend_arduino_libretiny.cpp +++ b/esphome/components/ota_network/ota_backend_arduino_libretiny.cpp @@ -40,7 +40,7 @@ OTAResponseTypes ArduinoLibreTinyOTABackend::end() { void ArduinoLibreTinyOTABackend::abort() { Update.abort(); } -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_LIBRETINY diff --git a/esphome/components/ota_network/ota_backend_arduino_libretiny.h b/esphome/components/ota_network/ota_backend_arduino_libretiny.h index 834d62293f..71e63020ef 100644 --- a/esphome/components/ota_network/ota_backend_arduino_libretiny.h +++ b/esphome/components/ota_network/ota_backend_arduino_libretiny.h @@ -18,7 +18,7 @@ class ArduinoLibreTinyOTABackend : public OTABackend { bool supports_compression() override { return false; } }; -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_LIBRETINY diff --git a/esphome/components/ota_network/ota_backend_arduino_rp2040.cpp b/esphome/components/ota_network/ota_backend_arduino_rp2040.cpp index 2f5cfeadff..217069a9e5 100644 --- a/esphome/components/ota_network/ota_backend_arduino_rp2040.cpp +++ b/esphome/components/ota_network/ota_backend_arduino_rp2040.cpp @@ -52,7 +52,7 @@ void ArduinoRP2040OTABackend::abort() { rp2040::preferences_prevent_write(false); } -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_RP2040 diff --git a/esphome/components/ota_network/ota_backend_arduino_rp2040.h b/esphome/components/ota_network/ota_backend_arduino_rp2040.h index 0f4f1b10ba..4842e96400 100644 --- a/esphome/components/ota_network/ota_backend_arduino_rp2040.h +++ b/esphome/components/ota_network/ota_backend_arduino_rp2040.h @@ -20,7 +20,7 @@ class ArduinoRP2040OTABackend : public OTABackend { bool supports_compression() override { return false; } }; -} // namespace ota +} // namespace ota_network } // namespace esphome #endif // USE_RP2040 diff --git a/esphome/components/ota_network/ota_backend_esp_idf.cpp b/esphome/components/ota_network/ota_backend_esp_idf.cpp index be40c25ec2..41969aba85 100644 --- a/esphome/components/ota_network/ota_backend_esp_idf.cpp +++ b/esphome/components/ota_network/ota_backend_esp_idf.cpp @@ -110,6 +110,6 @@ void IDFOTABackend::abort() { this->update_handle_ = 0; } -} // namespace ota +} // namespace ota_network } // namespace esphome #endif diff --git a/esphome/components/ota_network/ota_backend_esp_idf.h b/esphome/components/ota_network/ota_backend_esp_idf.h index ca2791808e..bf83199326 100644 --- a/esphome/components/ota_network/ota_backend_esp_idf.h +++ b/esphome/components/ota_network/ota_backend_esp_idf.h @@ -26,6 +26,6 @@ class IDFOTABackend : public OTABackend { char expected_bin_md5_[32]; }; -} // namespace ota +} // namespace ota_network } // namespace esphome #endif diff --git a/esphome/components/ota_network/ota_component.cpp b/esphome/components/ota_network/ota_component.cpp index abc25ffb6a..4e7f0880d7 100644 --- a/esphome/components/ota_network/ota_component.cpp +++ b/esphome/components/ota_network/ota_component.cpp @@ -523,5 +523,5 @@ void OTAComponent::on_safe_shutdown() { this->clean_rtc(); } -} // namespace ota +} // namespace ota_network } // namespace esphome diff --git a/esphome/components/ota_network/ota_component.h b/esphome/components/ota_network/ota_component.h index 23e9b082c8..468637177b 100644 --- a/esphome/components/ota_network/ota_component.h +++ b/esphome/components/ota_network/ota_component.h @@ -94,5 +94,5 @@ class OTAComponent : public ota::OTAComponent { 0x5afe5afe; ///< a magic number to indicate that safe mode should be entered on next boot }; -} // namespace ota +} // namespace ota_network } // namespace esphome