1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-08 03:40:28 +01:00

Revert "No walruses were harmed in the committing of this commit"

This reverts commit 68cb348a8b6eb61e36efe69e6cb9c5fcf95bd3c8.
This commit is contained in:
Keith Burzinski 2024-04-30 02:11:42 -05:00
parent 68cb348a8b
commit f82ca372a0
No known key found for this signature in database
GPG Key ID: 802564C5F0EEFFBE
2 changed files with 2 additions and 4 deletions

View File

@ -4,9 +4,8 @@ namespace esphome {
namespace ota {
#ifdef USE_OTA_STATE_CALLBACK
OTAGlobalCallback *global_ota_component = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
OTAGlobalCallback::OTAGlobalCallback() { global_ota_component = this; }
OTAGlobalCallback *global_ota_component =
new OTAGlobalCallback; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
#endif
} // namespace ota

View File

@ -68,7 +68,6 @@ class OTAComponent : public Component {
#ifdef USE_OTA_STATE_CALLBACK
class OTAGlobalCallback {
public:
OTAGlobalCallback();
void register_ota(OTAComponent *ota_caller) {
ota_caller->add_on_state_callback([this, ota_caller](OTAState state, float progress, uint8_t error) {
this->state_callback_.call(state, progress, error, ota_caller);