mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Add btnmatric toggle and one_check attributes
This commit is contained in:
parent
0e1b64527f
commit
e7bd0dc101
@ -1628,6 +1628,18 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
|
||||
} else {
|
||||
attr_out_int(obj, attr, lv_btn_get_checkable(obj));
|
||||
}
|
||||
} else if(check_obj_type(obj, LV_HASP_BTNMATRIX)) {
|
||||
if(update) {
|
||||
bool toggle = Parser::is_true(payload);
|
||||
if(toggle) {
|
||||
lv_btnmatrix_set_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECKABLE);
|
||||
} else {
|
||||
lv_btnmatrix_clear_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECKABLE);
|
||||
lv_btnmatrix_clear_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
}
|
||||
} else {
|
||||
attr_out_int(obj, attr, lv_btn_get_checkable(obj));
|
||||
}
|
||||
} else {
|
||||
goto attribute_not_found;
|
||||
}
|
||||
@ -1658,6 +1670,16 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
|
||||
}
|
||||
break; // attribute_found
|
||||
|
||||
case ATTR_ONE_CHECK:
|
||||
if(check_obj_type(obj, LV_HASP_BTNMATRIX)) {
|
||||
if(update) {
|
||||
lv_btnmatrix_set_one_check(obj, Parser::is_true(payload));
|
||||
} else {
|
||||
attr_out_int(obj, attr_p, lv_btnmatrix_get_one_check(obj));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ATTR_CRITICAL_VALUE:
|
||||
case ATTR_ANGLE:
|
||||
case ATTR_LABEL_COUNT:
|
||||
@ -1702,16 +1724,6 @@ void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* p
|
||||
}
|
||||
break;
|
||||
|
||||
case ATTR_ONE_CHECK:
|
||||
if(check_obj_type(obj, LV_HASP_BTNMATRIX)) {
|
||||
if(update) {
|
||||
lv_btnmatrix_set_one_check(obj, Parser::is_true(payload));
|
||||
} else {
|
||||
attr_out_int(obj, attr_p, lv_btnmatrix_get_one_check(obj));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ATTR_DELETE:
|
||||
if(!lv_obj_get_parent(obj)) {
|
||||
LOG_ERROR(TAG_ATTR, F(D_ATTRIBUTE_PAGE_METHOD_INVALID), attr_p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user