Fix ESP8266 OTA compression only starting framework v2.7.0 (#2610)

This commit is contained in:
Otto Winter 2021-10-22 17:23:31 +02:00 committed by Otto winter
parent 6bdae55ee1
commit 901ec918b1
No known key found for this signature in database
GPG key ID: 48ED2DDB96D7682C

View file

@ -5,6 +5,7 @@
#include "ota_component.h"
#include "ota_backend.h"
#include "esphome/core/macros.h"
namespace esphome {
namespace ota {
@ -16,7 +17,11 @@ class ArduinoESP8266OTABackend : public OTABackend {
OTAResponseTypes write(uint8_t *data, size_t len) override;
OTAResponseTypes end() override;
void abort() override;
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
bool supports_compression() override { return true; }
#else
bool supports_compression() override { return false; }
#endif
};
} // namespace ota