mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Allow https as image src parameter
This commit is contained in:
parent
5777066821
commit
0f61304f4f
@ -1047,8 +1047,9 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa
|
|||||||
if(update) {
|
if(update) {
|
||||||
my_image_release_resources(obj);
|
my_image_release_resources(obj);
|
||||||
|
|
||||||
if(payload != strstr_P(payload, PSTR("http://"))) { // not start with http
|
if(payload != strstr_P(payload, PSTR("http://")) || // not start with http
|
||||||
if(payload == strstr_P(payload, PSTR("L:"))) { // startsWith command/
|
payload != strstr_P(payload, PSTR("https://"))) { // not start with https
|
||||||
|
if(payload == strstr_P(payload, PSTR("L:"))) { // startsWith command/
|
||||||
lv_img_set_src(obj, payload);
|
lv_img_set_src(obj, payload);
|
||||||
} else if(payload == strstr_P(payload, PSTR("/littlefs/"))) { // startsWith command/
|
} else if(payload == strstr_P(payload, PSTR("/littlefs/"))) { // startsWith command/
|
||||||
char tempsrc[64] = "L:";
|
char tempsrc[64] = "L:";
|
||||||
@ -1131,14 +1132,21 @@ 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);
|
||||||
}
|
}
|
||||||
|
http.end();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(lv_img_src_get_type(obj)) {
|
switch(lv_img_src_get_type(obj)) {
|
||||||
case LV_IMG_SRC_FILE:
|
case LV_IMG_SRC_FILE:
|
||||||
*text = (char*)lv_img_get_file_name(obj);
|
*text = (char*)lv_img_get_file_name(obj);
|
||||||
|
break;
|
||||||
case LV_IMG_SRC_SYMBOL:
|
case LV_IMG_SRC_SYMBOL:
|
||||||
*text = (char*)lv_img_get_src(obj);
|
*text = (char*)lv_img_get_src(obj);
|
||||||
|
*text += strlen(LV_SYMBOL_DUMMY);
|
||||||
|
break;
|
||||||
|
case LV_IMG_SRC_VARIABLE:
|
||||||
|
// src_ptr + sizeof(lv_img_dsc_t) + w*h* depth
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HASP_ATTR_TYPE_STR;
|
return HASP_ATTR_TYPE_STR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user