mirror of
https://github.com/esphome/esphome.git
synced 2025-09-27 07:32:22 +01:00
Generate ARDUINO_VERSION_CODE in Python code (#3101)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifdef USE_ARDUINO
|
||||
|
||||
#include "http_request.h"
|
||||
#include "esphome/core/macros.h"
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/components/network/util.h"
|
||||
|
||||
@@ -42,12 +42,12 @@ void HttpRequestComponent::send(const std::vector<HttpRequestResponseTrigger *>
|
||||
begin_status = this->client_.begin(url);
|
||||
#endif
|
||||
#ifdef USE_ESP8266
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 7, 0)
|
||||
this->client_.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||
#elif ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#elif USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
this->client_.setFollowRedirects(true);
|
||||
#endif
|
||||
#if ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 6, 0)
|
||||
this->client_.setRedirectLimit(3);
|
||||
#endif
|
||||
begin_status = this->client_.begin(*this->get_wifi_client_(), url);
|
||||
|
Reference in New Issue
Block a user