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:
@@ -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
|
||||
|
@@ -5,8 +5,7 @@
|
||||
namespace esphome {
|
||||
namespace ota_mcuboot {
|
||||
|
||||
class OTAComponent : public ota::OTAComponent {
|
||||
};
|
||||
class OTAComponent : public ota::OTAComponent {};
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace ota_mcuboot
|
||||
} // namespace esphome
|
||||
|
@@ -15,5 +15,5 @@ class OTABackend {
|
||||
virtual bool supports_compression() = 0;
|
||||
};
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
@@ -40,7 +40,7 @@ OTAResponseTypes ArduinoESP32OTABackend::end() {
|
||||
|
||||
void ArduinoESP32OTABackend::abort() { Update.abort(); }
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_ESP32_FRAMEWORK_ARDUINO
|
||||
|
@@ -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
|
||||
|
@@ -52,7 +52,7 @@ void ArduinoESP8266OTABackend::abort() {
|
||||
esp8266::preferences_prevent_write(false);
|
||||
}
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
@@ -24,7 +24,7 @@ class ArduinoESP8266OTABackend : public OTABackend {
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
@@ -40,7 +40,7 @@ OTAResponseTypes ArduinoLibreTinyOTABackend::end() {
|
||||
|
||||
void ArduinoLibreTinyOTABackend::abort() { Update.abort(); }
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_LIBRETINY
|
||||
|
@@ -18,7 +18,7 @@ class ArduinoLibreTinyOTABackend : public OTABackend {
|
||||
bool supports_compression() override { return false; }
|
||||
};
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_LIBRETINY
|
||||
|
@@ -52,7 +52,7 @@ void ArduinoRP2040OTABackend::abort() {
|
||||
rp2040::preferences_prevent_write(false);
|
||||
}
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_RP2040
|
||||
|
@@ -20,7 +20,7 @@ class ArduinoRP2040OTABackend : public OTABackend {
|
||||
bool supports_compression() override { return false; }
|
||||
};
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
||||
#endif // USE_RP2040
|
||||
|
@@ -110,6 +110,6 @@ void IDFOTABackend::abort() {
|
||||
this->update_handle_ = 0;
|
||||
}
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
#endif
|
||||
|
@@ -26,6 +26,6 @@ class IDFOTABackend : public OTABackend {
|
||||
char expected_bin_md5_[32];
|
||||
};
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
#endif
|
||||
|
@@ -523,5 +523,5 @@ void OTAComponent::on_safe_shutdown() {
|
||||
this->clean_rtc();
|
||||
}
|
||||
|
||||
} // namespace ota
|
||||
} // namespace ota_network
|
||||
} // namespace esphome
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user