mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Suppress readonly warning if obj matches with existing object
This commit is contained in:
parent
b9e0a2fb30
commit
f06912824d
@ -1155,10 +1155,10 @@ static hasp_attribute_type_t attribute_common_align(lv_obj_t* obj, const char* a
|
|||||||
if(update) {
|
if(update) {
|
||||||
if(!strcasecmp_P(payload, PSTR("left"))) {
|
if(!strcasecmp_P(payload, PSTR("left"))) {
|
||||||
val = LV_LABEL_ALIGN_LEFT;
|
val = LV_LABEL_ALIGN_LEFT;
|
||||||
// pos = LV_ALIGN_IN_LEFT_MID;
|
// pos = LV_ALIGN_IN_LEFT_MID;
|
||||||
} else if(!strcasecmp_P(payload, PSTR("right"))) {
|
} else if(!strcasecmp_P(payload, PSTR("right"))) {
|
||||||
val = LV_LABEL_ALIGN_RIGHT;
|
val = LV_LABEL_ALIGN_RIGHT;
|
||||||
// pos = LV_ALIGN_IN_RIGHT_MID;
|
// pos = LV_ALIGN_IN_RIGHT_MID;
|
||||||
} else if(!strcasecmp_P(payload, PSTR("center"))) {
|
} else if(!strcasecmp_P(payload, PSTR("center"))) {
|
||||||
val = LV_LABEL_ALIGN_CENTER;
|
val = LV_LABEL_ALIGN_CENTER;
|
||||||
} else if(!strcasecmp_P(payload, PSTR("auto"))) {
|
} else if(!strcasecmp_P(payload, PSTR("auto"))) {
|
||||||
@ -1174,7 +1174,7 @@ static hasp_attribute_type_t attribute_common_align(lv_obj_t* obj, const char* a
|
|||||||
lv_obj_t* label = FindButtonLabel(obj);
|
lv_obj_t* label = FindButtonLabel(obj);
|
||||||
if(label) {
|
if(label) {
|
||||||
if(update) {
|
if(update) {
|
||||||
// lv_obj_align(label, NULL, pos, 0, 0);
|
// lv_obj_align(label, NULL, pos, 0, 0);
|
||||||
lv_label_set_align(label, val);
|
lv_label_set_align(label, val);
|
||||||
} else
|
} else
|
||||||
val = lv_label_get_align(label);
|
val = lv_label_get_align(label);
|
||||||
@ -2197,10 +2197,12 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attribute, const char
|
|||||||
|
|
||||||
case ATTR_OBJ:
|
case ATTR_OBJ:
|
||||||
text = (char*)obj_get_type_name(obj);
|
text = (char*)obj_get_type_name(obj);
|
||||||
if(update)
|
if(update && strcasecmp(payload, text) == 0)
|
||||||
ret = HASP_ATTR_TYPE_STR_READONLY;
|
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
|
else
|
||||||
ret = HASP_ATTR_TYPE_STR;
|
ret = HASP_ATTR_TYPE_STR; // Reply the current value
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ATTR_MODE:
|
case ATTR_MODE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user