Http images for Arduino only

This commit is contained in:
fvanroie 2021-08-02 20:50:49 +02:00
parent a0c9116fcb
commit 41d42a7ded

View File

@ -1007,6 +1007,7 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa
if(payload != strstr_P(payload, PSTR("http://"))) { if(payload != strstr_P(payload, PSTR("http://"))) {
lv_img_set_src(obj, payload); lv_img_set_src(obj, payload);
} else { } else {
#ifdef ARDUINO
HTTPClient http; HTTPClient http;
http.begin(payload); http.begin(payload);
int httpCode = http.GET(); int httpCode = http.GET();
@ -1077,6 +1078,7 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa
} else { } else {
LOG_WARNING(TAG_ATTR, "HTTP result %d", httpCode); LOG_WARNING(TAG_ATTR, "HTTP result %d", httpCode);
} }
#endif
} }
} else { } else {
switch(lv_img_src_get_type(obj)) { switch(lv_img_src_get_type(obj)) {