From ed33bf5f5f9c3e5926de6130171f5f4da1730cd8 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Tue, 9 Feb 2021 22:22:44 +0100 Subject: [PATCH] Add text attribute, obsolete txt --- src/hasp/hasp_attribute.cpp | 3 ++- src/hasp/hasp_attribute.h | 1 + src/hasp/hasp_object.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index 5b743234..43e6fe6c 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -1475,7 +1475,8 @@ void hasp_process_obj_attribute(lv_obj_t * obj, const char * attr_p, const char : hasp_out_int(obj, attr, lv_obj_get_hidden(obj)); break; // attribute_found - case ATTR_TXT: + case ATTR_TEXT: + case ATTR_TXT: // TODO: remove hasp_process_obj_attribute_txt(obj, attr, payload, update); break; // attribute_found diff --git a/src/hasp/hasp_attribute.h b/src/hasp/hasp_attribute.h index 0af852a8..c7381fc4 100644 --- a/src/hasp/hasp_attribute.h +++ b/src/hasp/hasp_attribute.h @@ -275,6 +275,7 @@ _HASP_ATTRIBUTE(SCALE_END_LINE_WIDTH, scale_end_line_width, lv_style_int_t) #define ATTR_VAL 15809 #define ATTR_COLOR 58979 #define ATTR_TXT 9328 +#define ATTR_TEXT 53869 #define ATTR_SRC 4964 #define ATTR_ID 6715 diff --git a/src/hasp/hasp_object.cpp b/src/hasp/hasp_object.cpp index e1fdce9f..34f369f7 100644 --- a/src/hasp/hasp_object.cpp +++ b/src/hasp/hasp_object.cpp @@ -445,7 +445,7 @@ static void selector_event_handler(lv_obj_t * obj, lv_event_t event) } // set the property - snprintf_P(property, sizeof(property), PSTR("val\":%d,\"txt"), val); + snprintf_P(property, sizeof(property), PSTR("val\":%d,\"text"), val); hasp_send_obj_attribute_str(obj, property, buffer); if(max > 0) dispatch_normalized_group_value(obj->user_data.groupid, NORMALIZE(val, 0, max), obj);