Suppress readonly warning if obj matches with existing object

This commit is contained in:
fvanroie 2021-10-30 00:26:52 +02:00
parent b9e0a2fb30
commit f06912824d

View File

@ -2197,10 +2197,12 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attribute, const char
case ATTR_OBJ:
text = (char*)obj_get_type_name(obj);
if(update)
ret = HASP_ATTR_TYPE_STR_READONLY;
if(update && strcasecmp(payload, text) == 0)
ret = HASP_ATTR_TYPE_METHOD_OK; // Value is already correct
else if(update)
ret = HASP_ATTR_TYPE_STR_READONLY; // Can't change to the new value
else
ret = HASP_ATTR_TYPE_STR;
ret = HASP_ATTR_TYPE_STR; // Reply the current value
break;
case ATTR_MODE: