1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

fix clang-format

This commit is contained in:
Tomasz Duda
2024-02-12 01:43:14 +01:00
parent f00476c9cc
commit eedabbfbb9
15 changed files with 20 additions and 21 deletions

View File

@@ -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<void(OTAState, float, uint8_t)> &&callback);
#endif
protected:
protected:
#ifdef USE_OTA_STATE_CALLBACK
CallbackManager<void(OTAState, float, uint8_t)> state_callback_{};
#endif

View File

@@ -5,8 +5,7 @@
namespace esphome {
namespace ota_mcuboot {
class OTAComponent : public ota::OTAComponent {
};
class OTAComponent : public ota::OTAComponent {};
}
}
} // namespace ota_mcuboot
} // namespace esphome

View File

@@ -15,5 +15,5 @@ class OTABackend {
virtual bool supports_compression() = 0;
};
} // namespace ota
} // namespace ota_network
} // namespace esphome

View File

@@ -40,7 +40,7 @@ OTAResponseTypes ArduinoESP32OTABackend::end() {
void ArduinoESP32OTABackend::abort() { Update.abort(); }
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO

View File

@@ -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

View File

@@ -52,7 +52,7 @@ void ArduinoESP8266OTABackend::abort() {
esp8266::preferences_prevent_write(false);
}
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif

View File

@@ -24,7 +24,7 @@ class ArduinoESP8266OTABackend : public OTABackend {
#endif
};
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif

View File

@@ -40,7 +40,7 @@ OTAResponseTypes ArduinoLibreTinyOTABackend::end() {
void ArduinoLibreTinyOTABackend::abort() { Update.abort(); }
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif // USE_LIBRETINY

View File

@@ -18,7 +18,7 @@ class ArduinoLibreTinyOTABackend : public OTABackend {
bool supports_compression() override { return false; }
};
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif // USE_LIBRETINY

View File

@@ -52,7 +52,7 @@ void ArduinoRP2040OTABackend::abort() {
rp2040::preferences_prevent_write(false);
}
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif // USE_RP2040

View File

@@ -20,7 +20,7 @@ class ArduinoRP2040OTABackend : public OTABackend {
bool supports_compression() override { return false; }
};
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif // USE_RP2040

View File

@@ -110,6 +110,6 @@ void IDFOTABackend::abort() {
this->update_handle_ = 0;
}
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif

View File

@@ -26,6 +26,6 @@ class IDFOTABackend : public OTABackend {
char expected_bin_md5_[32];
};
} // namespace ota
} // namespace ota_network
} // namespace esphome
#endif

View File

@@ -523,5 +523,5 @@ void OTAComponent::on_safe_shutdown() {
this->clean_rtc();
}
} // namespace ota
} // namespace ota_network
} // namespace esphome

View File

@@ -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