mirror of
https://github.com/esphome/esphome.git
synced 2025-10-25 13:13:48 +01:00
Generate ARDUINO_VERSION_CODE in Python code (#3101)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#ifdef USE_NEXTION_TFT_UPLOAD
|
||||
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/macros.h"
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/util.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/components/network/util.h"
|
||||
@@ -32,12 +32,12 @@ int Nextion::upload_by_chunks_(HTTPClient *http, int range_start) {
|
||||
range_end = this->tft_size_;
|
||||
|
||||
#ifdef USE_ESP8266
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
http->setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||
#elif ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#elif USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
http->setFollowRedirects(true);
|
||||
#endif
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
http->setRedirectLimit(3);
|
||||
#endif
|
||||
#endif
|
||||
@@ -148,12 +148,12 @@ void Nextion::upload_tft() {
|
||||
begin_status = http.begin(this->tft_url_.c_str());
|
||||
#endif
|
||||
#ifdef USE_ESP8266
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||
#elif ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#elif USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
http.setFollowRedirects(true);
|
||||
#endif
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
http.setRedirectLimit(3);
|
||||
#endif
|
||||
begin_status = http.begin(*this->get_wifi_client_(), this->tft_url_.c_str());
|
||||
|
||||
Reference in New Issue
Block a user