From 086c4d6371b43485eb2a69c0cbb94d912fd02cc6 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 20 May 2022 21:29:39 +0200 Subject: [PATCH] Rename OpenHASP to HASPmota --- lib/libesp32/berry/default/be_modtab.c | 12 +- .../{be_lv_openhasp.c => be_lv_haspmota.c} | 140 +++++++++--------- ...v_theme_openhasp.c => lv_theme_haspmota.c} | 6 +- ...v_theme_openhasp.h => lv_theme_haspmota.h} | 6 +- .../generate/be_lvgl_module.c | 6 +- .../lv_binding_berry/mapping/lv_funcs.h | 6 +- .../lv_binding_berry/tools/convert.py | 2 +- .../lv_binding_berry/tools/preprocessor.py | 2 +- .../openhasp.tapp => haspmota/haspmota.tapp} | Bin 60662 -> 60673 bytes .../haspmota_demo.tapp} | Bin 191468 -> 191479 bytes .../haspmota_widgets.tapp} | Bin .../berry/{openhasp => haspmota}/pages.jsonl | 0 .../robotocondensed_latin1.tapp | Bin tasmota/berry/haspmota_src/gen_haspmota.sh | 5 + .../haspmota.tapp} | Bin 60662 -> 60673 bytes .../haspmota_src/haspmota_core/autoexec.be | 7 + .../haspmota_core/haspmota.be} | 72 ++++----- .../haspmota_demo.tapp} | Bin 191468 -> 191479 bytes .../haspmota_demo}/autoexec.be | 6 +- .../haspmota_demo}/lv_tasmota_info.be | 0 .../haspmota_demo}/lv_tasmota_log.be | 0 .../haspmota_demo}/lv_wifi_graph.be | 0 .../haspmota_demo}/noun_Fan_35097_140.png | Bin .../haspmota_demo}/pages.jsonl | 10 +- .../haspmota_demo}/watch_ren_back_240.png | Bin .../haspmota_demo}/watch_ren_hour_240.png | Bin .../haspmota_demo}/watch_ren_min_240.png | Bin .../haspmota_demo}/watch_ren_sec_240.png | Bin .../haspmota_examples}/demo-all.jsonl | 0 .../haspmota_examples}/demo1.jsonl | 0 .../haspmota_examples}/demo2.jsonl | 0 .../haspmota_examples}/demo3.jsonl | 0 .../haspmota_examples}/lv.jsonl | 0 .../haspmota_widgets.tapp} | Bin .../haspmota_widgets}/autoexec.be | 2 +- .../haspmota_widgets}/lv_tasmota_info.be | 0 .../haspmota_widgets}/lv_tasmota_log.be | 0 .../haspmota_widgets}/lv_wifi_graph.be | 0 tasmota/berry/openhasp_src/gen_openhasp.sh | 5 - .../openhasp_src/openhasp_core/autoexec.be | 7 - tasmota/my_user_config.h | 2 +- tasmota/tasmota_configurations_ESP32.h | 4 +- tasmota/xdrv_52_3_berry_lvgl.ino | 6 +- 43 files changed, 153 insertions(+), 153 deletions(-) rename lib/libesp32/berry_tasmota/src/{be_lv_openhasp.c => be_lv_haspmota.c} (99%) rename lib/libesp32_lvgl/LVGL_assets/src/{lv_theme_openhasp.c => lv_theme_haspmota.c} (99%) rename lib/libesp32_lvgl/LVGL_assets/src/{lv_theme_openhasp.h => lv_theme_haspmota.h} (89%) rename tasmota/berry/{openhasp_src/openhasp.tapp => haspmota/haspmota.tapp} (96%) rename tasmota/berry/{openhasp/openhasp_demo.tapp => haspmota/haspmota_demo.tapp} (97%) rename tasmota/berry/{openhasp/openhasp_widgets.tapp => haspmota/haspmota_widgets.tapp} (100%) rename tasmota/berry/{openhasp => haspmota}/pages.jsonl (100%) rename tasmota/berry/{openhasp => haspmota}/robotocondensed_latin1.tapp (100%) create mode 100755 tasmota/berry/haspmota_src/gen_haspmota.sh rename tasmota/berry/{openhasp/openhasp.tapp => haspmota_src/haspmota.tapp} (96%) create mode 100644 tasmota/berry/haspmota_src/haspmota_core/autoexec.be rename tasmota/berry/{openhasp_src/openhasp_core/openhasp.be => haspmota_src/haspmota_core/haspmota.be} (97%) rename tasmota/berry/{openhasp_src/openhasp_demo.tapp => haspmota_src/haspmota_demo.tapp} (97%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/autoexec.be (87%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/lv_tasmota_info.be (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/lv_tasmota_log.be (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/lv_wifi_graph.be (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/noun_Fan_35097_140.png (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/pages.jsonl (92%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/watch_ren_back_240.png (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/watch_ren_hour_240.png (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/watch_ren_min_240.png (100%) rename tasmota/berry/{openhasp_src/openhasp_demo => haspmota_src/haspmota_demo}/watch_ren_sec_240.png (100%) rename tasmota/berry/{openhasp_src/openhasp_examples => haspmota_src/haspmota_examples}/demo-all.jsonl (100%) rename tasmota/berry/{openhasp_src/openhasp_examples => haspmota_src/haspmota_examples}/demo1.jsonl (100%) rename tasmota/berry/{openhasp_src/openhasp_examples => haspmota_src/haspmota_examples}/demo2.jsonl (100%) rename tasmota/berry/{openhasp_src/openhasp_examples => haspmota_src/haspmota_examples}/demo3.jsonl (100%) rename tasmota/berry/{openhasp_src/openhasp_examples => haspmota_src/haspmota_examples}/lv.jsonl (100%) rename tasmota/berry/{openhasp_src/openhasp_widgets.tapp => haspmota_src/haspmota_widgets.tapp} (100%) rename tasmota/berry/{openhasp_src/openhasp_widgets => haspmota_src/haspmota_widgets}/autoexec.be (64%) rename tasmota/berry/{openhasp_src/openhasp_widgets => haspmota_src/haspmota_widgets}/lv_tasmota_info.be (100%) rename tasmota/berry/{openhasp_src/openhasp_widgets => haspmota_src/haspmota_widgets}/lv_tasmota_log.be (100%) rename tasmota/berry/{openhasp_src/openhasp_widgets => haspmota_src/haspmota_widgets}/lv_wifi_graph.be (100%) delete mode 100755 tasmota/berry/openhasp_src/gen_openhasp.sh delete mode 100644 tasmota/berry/openhasp_src/openhasp_core/autoexec.be diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c index 5ed4a99e6..d0b71fc4b 100644 --- a/lib/libesp32/berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -52,9 +52,9 @@ be_extern_native_module(crc); be_extern_native_module(lv); be_extern_native_module(lv_extra); be_extern_native_module(lv_tasmota); -#ifdef USE_LVGL_OPENHASP -be_extern_native_module(openhasp); -#endif // USE_LVGL_OPENHASP +#ifdef USE_LVGL_HASPMOTA +be_extern_native_module(haspmota); +#endif // USE_LVGL_HASPMOTA #endif // USE_LVGL /* user-defined modules declare start */ @@ -137,9 +137,9 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { &be_native_module(lv), &be_native_module(lv_extra), &be_native_module(lv_tasmota), -#ifdef USE_LVGL_OPENHASP - &be_native_module(openhasp), -#endif // USE_LVGL_OPENHASP +#ifdef USE_LVGL_HASPMOTA + &be_native_module(haspmota), +#endif // USE_LVGL_HASPMOTA #endif // USE_LVGL #ifdef USE_ENERGY_SENSOR &be_native_module(energy), diff --git a/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c similarity index 99% rename from lib/libesp32/berry_tasmota/src/be_lv_openhasp.c rename to lib/libesp32/berry_tasmota/src/be_lv_haspmota.c index 1f82d2643..2bb290dca 100644 --- a/lib/libesp32/berry_tasmota/src/be_lv_openhasp.c +++ b/lib/libesp32/berry_tasmota/src/be_lv_haspmota.c @@ -1,10 +1,10 @@ /******************************************************************** - * Tasmota OpenHASP solidified + * Tasmota HASPmota solidified *******************************************************************/ #include "be_constobj.h" #ifdef USE_LVGL -#ifdef USE_LVGL_OPENHASP +#ifdef USE_LVGL_HASPMOTA extern const bclass be_class_lv_anim; extern const bclass be_class_lv_arc; @@ -5847,39 +5847,10 @@ void be_load_lvh_qrcode_class(bvm *vm) { be_pop(vm, 1); } -/******************************************************************** -** Solidified function: _anonymous_ -********************************************************************/ -be_local_closure(openhasp__anonymous_, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_literal("OpenHASP"), - }), - be_str_literal("_anonymous_"), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x5C080200, // 0001 MOVE R2 R1 - 0x7C080000, // 0002 CALL R2 0 - 0x80040400, // 0003 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: do_action ********************************************************************/ -be_local_closure(OpenHASP_do_action, /* name */ +be_local_closure(HASPmota_do_action, /* name */ be_nested_proto( 10, /* nstack */ 3, /* argc */ @@ -5991,7 +5962,7 @@ be_local_closure(OpenHASP_do_action, /* name */ /******************************************************************** ** Solidified function: pages_list_sorted ********************************************************************/ -be_local_closure(OpenHASP_pages_list_sorted, /* name */ +be_local_closure(HASPmota_pages_list_sorted, /* name */ be_nested_proto( 8, /* nstack */ 2, /* argc */ @@ -6071,7 +6042,7 @@ be_local_closure(OpenHASP_pages_list_sorted, /* name */ /******************************************************************** ** Solidified function: get_page_cur ********************************************************************/ -be_local_closure(OpenHASP_get_page_cur, /* name */ +be_local_closure(HASPmota_get_page_cur, /* name */ be_nested_proto( 3, /* nstack */ 1, /* argc */ @@ -6101,7 +6072,7 @@ be_local_closure(OpenHASP_get_page_cur, /* name */ /******************************************************************** ** Solidified function: start ********************************************************************/ -be_local_closure(OpenHASP_start, /* name */ +be_local_closure(HASPmota_start, /* name */ be_nested_proto( 11, /* nstack */ 3, /* argc */ @@ -6131,7 +6102,7 @@ be_local_closure(OpenHASP_start, /* name */ /* K16 */ be_nested_str_literal("font_embedded"), /* K17 */ be_nested_str_literal("robotocondensed"), /* K18 */ be_nested_str_literal("montserrat"), - /* K19 */ be_nested_str_literal("theme_openhasp_init"), + /* K19 */ be_nested_str_literal("theme_haspmota_init"), /* K20 */ be_const_int(0), /* K21 */ be_nested_str_literal("color"), /* K22 */ be_const_int(16711935), @@ -6263,7 +6234,7 @@ be_local_closure(OpenHASP_start, /* name */ /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(OpenHASP_init, /* name */ +be_local_closure(HASPmota_init, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -6297,7 +6268,7 @@ be_local_closure(OpenHASP_init, /* name */ /******************************************************************** ** Solidified function: register_event ********************************************************************/ -be_local_closure(OpenHASP_register_event, /* name */ +be_local_closure(HASPmota_register_event, /* name */ be_nested_proto( 13, /* nstack */ 3, /* argc */ @@ -6373,7 +6344,7 @@ be_local_closure(OpenHASP_register_event, /* name */ /******************************************************************** ** Solidified function: parse_page ********************************************************************/ -be_local_closure(OpenHASP_parse_page, /* name */ +be_local_closure(HASPmota_parse_page, /* name */ be_nested_proto( 9, /* nstack */ 2, /* argc */ @@ -6465,7 +6436,7 @@ be_local_closure(OpenHASP_parse_page, /* name */ /******************************************************************** ** Solidified function: deinit ********************************************************************/ -be_local_closure(OpenHASP_deinit, /* name */ +be_local_closure(HASPmota_deinit, /* name */ be_nested_proto( 5, /* nstack */ 1, /* argc */ @@ -6512,7 +6483,7 @@ be_local_closure(OpenHASP_deinit, /* name */ /******************************************************************** ** Solidified function: page_dir_to ********************************************************************/ -be_local_closure(OpenHASP_page_dir_to, /* name */ +be_local_closure(HASPmota_page_dir_to, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -6573,7 +6544,7 @@ be_local_closure(OpenHASP_page_dir_to, /* name */ /******************************************************************** ** Solidified function: _load ********************************************************************/ -be_local_closure(OpenHASP__load, /* name */ +be_local_closure(HASPmota__load, /* name */ be_nested_proto( 14, /* nstack */ 2, /* argc */ @@ -6668,7 +6639,7 @@ be_local_closure(OpenHASP__load, /* name */ /******************************************************************** ** Solidified function: parse ********************************************************************/ -be_local_closure(OpenHASP_parse, /* name */ +be_local_closure(HASPmota_parse, /* name */ be_nested_proto( 9, /* nstack */ 2, /* argc */ @@ -6722,7 +6693,7 @@ be_local_closure(OpenHASP_parse, /* name */ /******************************************************************** ** Solidified function: sort ********************************************************************/ -be_local_closure(OpenHASP_sort, /* name */ +be_local_closure(HASPmota_sort, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -6778,7 +6749,7 @@ be_local_closure(OpenHASP_sort, /* name */ /******************************************************************** ** Solidified function: parse_obj ********************************************************************/ -be_local_closure(OpenHASP_parse_obj, /* name */ +be_local_closure(HASPmota_parse_obj, /* name */ be_nested_proto( 20, /* nstack */ 3, /* argc */ @@ -7022,7 +6993,7 @@ be_local_closure(OpenHASP_parse_obj, /* name */ /******************************************************************** ** Solidified function: event_dispatch ********************************************************************/ -be_local_closure(OpenHASP_event_dispatch, /* name */ +be_local_closure(HASPmota_event_dispatch, /* name */ be_nested_proto( 9, /* nstack */ 2, /* argc */ @@ -7090,27 +7061,27 @@ be_local_closure(OpenHASP_event_dispatch, /* name */ /******************************************************************** -** Solidified class: OpenHASP +** Solidified class: HASPmota ********************************************************************/ -be_local_class(OpenHASP, +be_local_class(HASPmota, 10, NULL, be_nested_map(43, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_literal("lvh_textarea", 41), be_const_class(be_class_lvh_textarea) }, { be_const_key_literal("scr", -1), be_const_var(3) }, - { be_const_key_literal("event_dispatch", 16), be_const_closure(OpenHASP_event_dispatch_closure) }, + { be_const_key_literal("event_dispatch", 16), be_const_closure(HASPmota_event_dispatch_closure) }, { be_const_key_literal("lvh_bar", -1), be_const_class(be_class_lvh_bar) }, { be_const_key_literal("lvh_img", -1), be_const_class(be_class_lvh_img) }, { be_const_key_literal("event", -1), be_const_var(8) }, - { be_const_key_literal("do_action", 33), be_const_closure(OpenHASP_do_action_closure) }, - { be_const_key_literal("pages_list_sorted", -1), be_const_closure(OpenHASP_pages_list_sorted_closure) }, + { be_const_key_literal("do_action", 33), be_const_closure(HASPmota_do_action_closure) }, + { be_const_key_literal("pages_list_sorted", -1), be_const_closure(HASPmota_pages_list_sorted_closure) }, { be_const_key_literal("lvh_btnmatrix", 42), be_const_class(be_class_lvh_btnmatrix) }, - { be_const_key_literal("start", -1), be_const_closure(OpenHASP_start_closure) }, - { be_const_key_literal("init", 5), be_const_closure(OpenHASP_init_closure) }, + { be_const_key_literal("start", -1), be_const_closure(HASPmota_start_closure) }, + { be_const_key_literal("init", 5), be_const_closure(HASPmota_init_closure) }, { be_const_key_literal("lvh_scr", -1), be_const_class(be_class_lvh_scr) }, - { be_const_key_literal("parse_page", -1), be_const_closure(OpenHASP_parse_page_closure) }, - { be_const_key_literal("register_event", 24), be_const_closure(OpenHASP_register_event_closure) }, + { be_const_key_literal("parse_page", -1), be_const_closure(HASPmota_parse_page_closure) }, + { be_const_key_literal("register_event", 24), be_const_closure(HASPmota_register_event_closure) }, { be_const_key_literal("lvh_roller", 34), be_const_class(be_class_lvh_roller) }, { be_const_key_literal("lvh_page", 11), be_const_class(be_class_lvh_page) }, { be_const_key_literal("lvh_page_cur_idx", -1), be_const_var(6) }, @@ -7118,13 +7089,13 @@ be_local_class(OpenHASP, { be_const_key_literal("hres", 38), be_const_var(1) }, { be_const_key_literal("dark", -1), be_const_var(0) }, { be_const_key_literal("lvh_label", 37), be_const_class(be_class_lvh_label) }, - { be_const_key_literal("deinit", 14), be_const_closure(OpenHASP_deinit_closure) }, - { be_const_key_literal("page_dir_to", -1), be_const_closure(OpenHASP_page_dir_to_closure) }, - { be_const_key_literal("parse_obj", -1), be_const_closure(OpenHASP_parse_obj_closure) }, + { be_const_key_literal("deinit", 14), be_const_closure(HASPmota_deinit_closure) }, + { be_const_key_literal("page_dir_to", -1), be_const_closure(HASPmota_page_dir_to_closure) }, + { be_const_key_literal("parse_obj", -1), be_const_closure(HASPmota_parse_obj_closure) }, { be_const_key_literal("lvh_spinner", -1), be_const_class(be_class_lvh_spinner) }, - { be_const_key_literal("_load", -1), be_const_closure(OpenHASP__load_closure) }, + { be_const_key_literal("_load", -1), be_const_closure(HASPmota__load_closure) }, { be_const_key_literal("lvh_qrcode", -1), be_const_class(be_class_lvh_qrcode) }, - { be_const_key_literal("parse", -1), be_const_closure(OpenHASP_parse_closure) }, + { be_const_key_literal("parse", -1), be_const_closure(HASPmota_parse_closure) }, { be_const_key_literal("lvh_pages", 2), be_const_var(5) }, { be_const_key_literal("lvh_line", -1), be_const_class(be_class_lvh_line) }, { be_const_key_literal("lvh_switch", -1), be_const_class(be_class_lvh_switch) }, @@ -7132,32 +7103,61 @@ be_local_class(OpenHASP, { be_const_key_literal("r16", -1), be_const_var(4) }, { be_const_key_literal("def_templ_name", -1), be_nested_str_literal("pages.jsonl") }, { be_const_key_literal("lvh_obj", 19), be_const_class(be_class_lvh_obj) }, - { be_const_key_literal("sort", 23), be_const_static_closure(OpenHASP_sort_closure) }, + { be_const_key_literal("sort", 23), be_const_static_closure(HASPmota_sort_closure) }, { be_const_key_literal("lvh_dropdown", -1), be_const_class(be_class_lvh_dropdown) }, { be_const_key_literal("lvh_checkbox", -1), be_const_class(be_class_lvh_checkbox) }, { be_const_key_literal("lvh_slider", -1), be_const_class(be_class_lvh_slider) }, { be_const_key_literal("vres", -1), be_const_var(2) }, { be_const_key_literal("lvh_btn", -1), be_const_class(be_class_lvh_btn) }, { be_const_key_literal("event_cb", -1), be_const_var(9) }, - { be_const_key_literal("get_page_cur", -1), be_const_closure(OpenHASP_get_page_cur_closure) }, + { be_const_key_literal("get_page_cur", -1), be_const_closure(HASPmota_get_page_cur_closure) }, })), - be_str_literal("OpenHASP") + be_str_literal("HASPmota") ); /******************************************************************** -** Solidified module: openhasp +** Solidified function: _anonymous_ ********************************************************************/ -be_local_module(openhasp, - "openhasp", +be_local_closure(haspmota__anonymous_, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_literal("HASPmota"), + }), + be_str_literal("_anonymous_"), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x5C080200, // 0001 MOVE R2 R1 + 0x7C080000, // 0002 CALL R2 0 + 0x80040400, // 0003 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified module: haspmota +********************************************************************/ +be_local_module(haspmota, + "haspmota", be_nested_map(2, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_literal("OpenHASP", -1), be_const_class(be_class_OpenHASP) }, - { be_const_key_literal("init", 0), be_const_closure(openhasp__anonymous__closure) }, + { be_const_key_literal("HASPmota", -1), be_const_class(be_class_HASPmota) }, + { be_const_key_literal("init", -1), be_const_closure(haspmota__anonymous__closure) }, })) ); -BE_EXPORT_VARIABLE be_define_const_native_module(openhasp); +BE_EXPORT_VARIABLE be_define_const_native_module(haspmota); /********************************************************************/ -#endif // USE_LVGL_OPENHASP +#endif // USE_LVGL_HASPMOTA #endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.c b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c similarity index 99% rename from lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.c rename to lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c index d0f78a955..96f4c4c5e 100644 --- a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.c +++ b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c @@ -8,7 +8,7 @@ *********************/ #include "../lvgl.h" /*To see all the widgets*/ -#include "lv_theme_openhasp.h" +#include "lv_theme_haspmota.h" #include "misc/lv_gc.h" /********************* @@ -625,7 +625,7 @@ static void style_init(void) * GLOBAL FUNCTIONS **********************/ -lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) +lv_theme_t * lv_theme_haspmota_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) { /*This trick is required only to avoid the garbage collection of @@ -658,7 +658,7 @@ lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, return (lv_theme_t *)&theme; } -bool lv_theme_openhasp_is_inited(void) +bool lv_theme_haspmota_is_inited(void) { return inited; } diff --git a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.h b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h similarity index 89% rename from lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.h rename to lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h index f1aacfe04..7276f485d 100644 --- a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_openhasp.h +++ b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h @@ -1,5 +1,5 @@ /** - * @file lv_theme_openhasp.h + * @file lv_theme_haspmota.h * */ @@ -40,9 +40,9 @@ typedef enum { * @param font pointer to a font to use. * @return a pointer to reference this theme later */ -lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font); +lv_theme_t * lv_theme_haspmota_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font); -bool lv_theme_openhasp_is_inited(void); +bool lv_theme_haspmota_is_inited(void); /********************** * MACROS diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c index aec4cbf45..9f333f36b 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c @@ -9,7 +9,7 @@ #include "lvgl.h" #include "be_mapping.h" #include "lv_berry.h" -#include "lv_theme_openhasp.h" +#include "lv_theme_haspmota.h" extern int lv0_member(bvm *vm); // resolve virtual members extern int lv0_load_font(bvm *vm); @@ -163,9 +163,9 @@ const be_ntv_func_def_t lv_func[] = { { "theme_get_font_normal", { (const void*) &lv_theme_get_font_normal, "lv.lv_font", "(lv.lv_obj)" } }, { "theme_get_font_small", { (const void*) &lv_theme_get_font_small, "lv.lv_font", "(lv.lv_obj)" } }, { "theme_get_from_obj", { (const void*) &lv_theme_get_from_obj, "lv.lv_theme", "(lv.lv_obj)" } }, + { "theme_haspmota_init", { (const void*) &lv_theme_haspmota_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" } }, + { "theme_haspmota_is_inited", { (const void*) &lv_theme_haspmota_is_inited, "b", "" } }, { "theme_mono_init", { (const void*) &lv_theme_mono_init, "lv.lv_theme", "(lv.lv_disp)b(lv.lv_font)" } }, - { "theme_openhasp_init", { (const void*) &lv_theme_openhasp_init, "lv.lv_theme", "(lv.lv_disp)(lv.lv_color)(lv.lv_color)b(lv.lv_font)" } }, - { "theme_openhasp_is_inited", { (const void*) &lv_theme_openhasp_is_inited, "b", "" } }, { "theme_set_apply_cb", { (const void*) &lv_theme_set_apply_cb, "", "(lv.lv_theme)^lv_theme_apply_cb^" } }, { "theme_set_parent", { (const void*) &lv_theme_set_parent, "", "(lv.lv_theme)(lv.lv_theme)" } }, { "timer_create", { (const void*) &lv_timer_create, "lv.lv_timer", "^lv_timer_cb^i." } }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h index 9827808e3..46c91aa8f 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h @@ -1151,7 +1151,7 @@ void lv_textarea_cursor_left(lv_obj_t * obj) void lv_textarea_cursor_down(lv_obj_t * obj) void lv_textarea_cursor_up(lv_obj_t * obj) -// ../../LVGL_assets/src/lv_theme_openhasp.h -lv_theme_t * lv_theme_openhasp_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) -bool lv_theme_openhasp_is_inited(void) +// ../../LVGL_assets/src/lv_theme_haspmota.h +lv_theme_t * lv_theme_haspmota_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) +bool lv_theme_haspmota_is_inited(void) diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py index c305bdc34..11f3a001c 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py @@ -741,7 +741,7 @@ print("""/******************************************************************** #include "lvgl.h" #include "be_mapping.h" #include "lv_berry.h" -#include "lv_theme_openhasp.h" +#include "lv_theme_haspmota.h" extern int lv0_member(bvm *vm); // resolve virtual members extern int lv0_load_font(bvm *vm); diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py index 892a9cc32..d9b56084c 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py @@ -78,7 +78,7 @@ lv_fun_globs = [ #"**/*.h", ] headers_names = list_files(lv_src_prefix, lv_fun_globs) -headers_names += list_files("../../LVGL_assets/src/", ["lv_theme_openhasp.h"]) +headers_names += list_files("../../LVGL_assets/src/", ["lv_theme_haspmota.h"]) # headers_names += ["lv_pre_style.h"] # for LVGL v7, add pre-generated style functions from C preprocessor # unit test diff --git a/tasmota/berry/openhasp_src/openhasp.tapp b/tasmota/berry/haspmota/haspmota.tapp similarity index 96% rename from tasmota/berry/openhasp_src/openhasp.tapp rename to tasmota/berry/haspmota/haspmota.tapp index f14e884386fa460d2319108f8e0d3608ff76d483..4ea6c2bdfff20f3b04f542e345543be615da4efd 100644 GIT binary patch delta 1058 zcmaJ=%WD%s9Nz72LpwpR(9+sg{gG9g)Mn!Y1rZM#EYVO%O>%B`)1}#Vw;Pg48>&$1 zrQ!>9Y!y6OA3^ls=FmT(M?o)o@g!msMG!lP=XV=d$b72L1MKQ0Nu3GIorLkyCXen`srK9~T$&pY)b1K|z$iih>}w(@+IU zSSw=4Yo&tiU=1ly&~lU7xB)XJ&Ql0bw7FZwTA^?ZX3YW|icUau|5gu2BRQvN#QKqG z7o1J(H=fx!R!Q9`9F9bgKM3Gjrt5q5$%{2X@UAxqkN-2s`AZA>^5uUFk~oo04bc%G zN@m1Z3(F%<#cMGJHue9%_Q_<^1D{}r)YHibkmYD&;XVdQQhL|Mfa-PNEs@0Ky+@dJ z0C2HvL=cK9Xj&`s6~S?^ow2fIghMPe6hY*ZoFR$8Fo`!;TR0yzx`{wV;ud$cbv5Xt zJ00n59FfnV+Z?zzm1K~Q;=Wb;I(=XJ;I~sg>bPQvKDu!AaX?`Wz_{h;ngxzNVdO9Z zQ1}=mb?YO~B7=)}eeiw}cxBSI^pbnr4@*b4?_uPlfE_TWOl)eFIcosU8^CIiovJ9S(+BAnggjTQANZq?@&-RZ3$UBW$(q{o2qzo_lZo4cf_E{Ml$8r=#zX zCDz(?UYy8vo#&IO`bi(G)Z@Du*(hzqYs1NV@5`x4ccX_Fq(8jav`gBmU2?Y3?}?Pm lHF^*Kt%EMA)!%1%{s0v(tG6NVWs6tcT`KQ_Jf@z2tfAlPCT!u6|#Jb!vhEm8Tq5OPNB zXkg0ZiFkfJ1M`ypkDSRPGe%z4g*S0?6~%o4R!SD@T0%QM3{EH}FBj-oN%-5C1vw~v zT*N@=0B!A_ZQT*F-?g%n-L8g~nL_~pf^v-~xCN$hBBvw2kE!|sM7-QXW?erTxGOuy zSyz<2xBvij?&mqx4 z`TRY%%o2e~9jl5Cu{wa_7JyLZJt2KpK5;7&9lPd$FJq8LCf@PaoGHwVZ(JB;&ikQ- zp_b7sP0_Ux1g#W;jH7?4nbk5$KqBrKnY`V%m@za7do&5f93)C}E9tuPnFlLuxEpo4 zLoOCu9O_|l-zttK>fZw|uI>b%ARP{iLRL(D;AxWuWtE$f;qrC|JS*?$Wq$grso|78 zW$u;Un#jtT8HiK<06>`p0PKQoWh5-twMwZVe_n&iXbS+(X Wmc`tIP%lVykI1_Uba&Y=hVUC)V1W_< diff --git a/tasmota/berry/openhasp/openhasp_demo.tapp b/tasmota/berry/haspmota/haspmota_demo.tapp similarity index 97% rename from tasmota/berry/openhasp/openhasp_demo.tapp rename to tasmota/berry/haspmota/haspmota_demo.tapp index aac2e596797e591c167663d041dd031899eec205..313b3158e03523b531a1223420d5f4f3b82a19a9 100644 GIT binary patch delta 1577 zcmZuxS!fec6rFd|*g7##QE^FZpGMnsOWi8e4eNs1Hnh?d^~ZM7jwUtj#AYIG6~qN% zD`;cT_aXS>_95aDWkkh(2%^Og!KJ7mewj2a>W>@J>dfeS)-Rcx0$vJejA<+vvp#$|1|Yytj{+XR&t8zC)Hr&vzC@#}Zp^qZ$2 zo`@`T%I+OPC?b~PxfD*GLeDK0Rehqv>dyYHFmca5J9*psG+TG{+Y6~9dCwlU>)=91 z0Ry)?dUJFz<0_>f**}O}$<^~lXO?KKDcX%vS8_Q{TUu+v!cH;bX^Ti5A=Vl-d2-9D zPqrMU%~x#!W+kq9rzPatZ6<(R%D|+==UT4`O*DHqF(7%(D#9N7^%7-I(F3BRe+4Lmqi93!1}xw3&G_DU z`DupZw563zE29&!uP^35cQodYcG)L(vTzF$uL%mlW4O~XNW2l@JLk^Fj zW9*>ynfc$y{2C^jjZ}@J3kJo9apagzeSAm~THS@zBy)bC)MRRTG#T22o}3Bu7gMwp z%biiNi08{({2rl`4Iy5M+ojfMNOZI5y15%Rqa4aY`uo7AnF%XU1%GO@EG{Hrs;GH4KFNCnu#6!&^l>4thX1B7 z$ovtgCp`EM@+Je7j7*QI9QgyO`1cae(4Twl@7#gxF=W2dR?ebcY4TtM@Pzy{s6jsg D|0+?| delta 1572 zcmZuxTWAzl7@qS_)}%8oL`?CLs0TNi&23{^BiL3^t45P78*#m~NX=|AYc@_Y%kHcs zdGLaw_@K?Y=pp!MZ3#s*Zec`9&=(0oM5!9YzG||YAf;fvw6Q%idd@i2g|p26{r~y? z`*|@gPmjwDt<7SABv`+TZG+)0@Qmw&D8Js4@fTj(9F1Jx9L3KqVBS~5Kyqjd`LgTErx#RH^0541>+hF~1;IL2RpQD%H5uqi>OGoW z70WR_*XnwKcjg;u#S~B%Zv@fts4g;qx7VDWdRkuM1oLILg&awcF&+Xo&ouO2A$^J zwFl*6bMkhAmpmFIf9`g&PZXC!o4Dg%pnhq z%8uAK2ex~;NbWBN!X-1g1e%@kFmF{s#XLv*d_BC{AeWsWIwZ|v0-dg-01v_7F#+gpng)_*#(jGyiD^2cA L0iIPd3DoF6tt~gR diff --git a/tasmota/berry/openhasp/openhasp_widgets.tapp b/tasmota/berry/haspmota/haspmota_widgets.tapp similarity index 100% rename from tasmota/berry/openhasp/openhasp_widgets.tapp rename to tasmota/berry/haspmota/haspmota_widgets.tapp diff --git a/tasmota/berry/openhasp/pages.jsonl b/tasmota/berry/haspmota/pages.jsonl similarity index 100% rename from tasmota/berry/openhasp/pages.jsonl rename to tasmota/berry/haspmota/pages.jsonl diff --git a/tasmota/berry/openhasp/robotocondensed_latin1.tapp b/tasmota/berry/haspmota/robotocondensed_latin1.tapp similarity index 100% rename from tasmota/berry/openhasp/robotocondensed_latin1.tapp rename to tasmota/berry/haspmota/robotocondensed_latin1.tapp diff --git a/tasmota/berry/haspmota_src/gen_haspmota.sh b/tasmota/berry/haspmota_src/gen_haspmota.sh new file mode 100755 index 000000000..c81c0fdac --- /dev/null +++ b/tasmota/berry/haspmota_src/gen_haspmota.sh @@ -0,0 +1,5 @@ +# generate all haspmota tapp files +rm haspmota.tapp; zip -j -0 haspmota.tapp haspmota_core/* +rm haspmota_demo.tapp ; zip -j -0 haspmota_demo.tapp haspmota_demo/* haspmota_core/haspmota.be +cp haspmota.tapp ../haspmota +cp haspmota_demo.tapp ../haspmota diff --git a/tasmota/berry/openhasp/openhasp.tapp b/tasmota/berry/haspmota_src/haspmota.tapp similarity index 96% rename from tasmota/berry/openhasp/openhasp.tapp rename to tasmota/berry/haspmota_src/haspmota.tapp index f14e884386fa460d2319108f8e0d3608ff76d483..4ea6c2bdfff20f3b04f542e345543be615da4efd 100644 GIT binary patch delta 1058 zcmaJ=%WD%s9Nz72LpwpR(9+sg{gG9g)Mn!Y1rZM#EYVO%O>%B`)1}#Vw;Pg48>&$1 zrQ!>9Y!y6OA3^ls=FmT(M?o)o@g!msMG!lP=XV=d$b72L1MKQ0Nu3GIorLkyCXen`srK9~T$&pY)b1K|z$iih>}w(@+IU zSSw=4Yo&tiU=1ly&~lU7xB)XJ&Ql0bw7FZwTA^?ZX3YW|icUau|5gu2BRQvN#QKqG z7o1J(H=fx!R!Q9`9F9bgKM3Gjrt5q5$%{2X@UAxqkN-2s`AZA>^5uUFk~oo04bc%G zN@m1Z3(F%<#cMGJHue9%_Q_<^1D{}r)YHibkmYD&;XVdQQhL|Mfa-PNEs@0Ky+@dJ z0C2HvL=cK9Xj&`s6~S?^ow2fIghMPe6hY*ZoFR$8Fo`!;TR0yzx`{wV;ud$cbv5Xt zJ00n59FfnV+Z?zzm1K~Q;=Wb;I(=XJ;I~sg>bPQvKDu!AaX?`Wz_{h;ngxzNVdO9Z zQ1}=mb?YO~B7=)}eeiw}cxBSI^pbnr4@*b4?_uPlfE_TWOl)eFIcosU8^CIiovJ9S(+BAnggjTQANZq?@&-RZ3$UBW$(q{o2qzo_lZo4cf_E{Ml$8r=#zX zCDz(?UYy8vo#&IO`bi(G)Z@Du*(hzqYs1NV@5`x4ccX_Fq(8jav`gBmU2?Y3?}?Pm lHF^*Kt%EMA)!%1%{s0v(tG6NVWs6tcT`KQ_Jf@z2tfAlPCT!u6|#Jb!vhEm8Tq5OPNB zXkg0ZiFkfJ1M`ypkDSRPGe%z4g*S0?6~%o4R!SD@T0%QM3{EH}FBj-oN%-5C1vw~v zT*N@=0B!A_ZQT*F-?g%n-L8g~nL_~pf^v-~xCN$hBBvw2kE!|sM7-QXW?erTxGOuy zSyz<2xBvij?&mqx4 z`TRY%%o2e~9jl5Cu{wa_7JyLZJt2KpK5;7&9lPd$FJq8LCf@PaoGHwVZ(JB;&ikQ- zp_b7sP0_Ux1g#W;jH7?4nbk5$KqBrKnY`V%m@za7do&5f93)C}E9tuPnFlLuxEpo4 zLoOCu9O_|l-zttK>fZw|uI>b%ARP{iLRL(D;AxWuWtE$f;qrC|JS*?$Wq$grso|78 zW$u;Un#jtT8HiK<06>`p0PKQoWh5-twMwZVe_n&iXbS+(X Wmc`tIP%lVykI1_Uba&Y=hVUC)V1W_< diff --git a/tasmota/berry/haspmota_src/haspmota_core/autoexec.be b/tasmota/berry/haspmota_src/haspmota_core/autoexec.be new file mode 100644 index 000000000..138301eab --- /dev/null +++ b/tasmota/berry/haspmota_src/haspmota_core/autoexec.be @@ -0,0 +1,7 @@ +# start haspmota +# package with +# rm haspmota.tapp; zip -j -0 haspmota.tapp haspmota_core/* +import haspmota + +# defer start to make sure all modules and tapp applications were loaded first +tasmota.set_timer(1000, /-> haspmota.start()) diff --git a/tasmota/berry/openhasp_src/openhasp_core/openhasp.be b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be similarity index 97% rename from tasmota/berry/openhasp_src/openhasp_core/openhasp.be rename to tasmota/berry/haspmota_src/haspmota_core/haspmota.be index d4de2b209..2e101cef3 100644 --- a/tasmota/berry/openhasp_src/openhasp_core/openhasp.be +++ b/tasmota/berry/haspmota_src/haspmota_core/haspmota.be @@ -1,19 +1,19 @@ -# OpenHASP compatibility module +# HASPMota - OpenHASP compatibility module # -# use `import openhasp` and set the JSONL definitions in `pages.jsonl` +# use `import haspmota` and set the JSONL definitions in `pages.jsonl` # # As an optimization `0 #- lv.PART_MAIN | lv.STATE_DEFAULT -#` is replaced with `0` # -# rm openhasp.tapp; zip -j -0 openhasp.tapp openhasp_core/* +# rm haspmota.tapp; zip -j -0 haspmota.tapp haspmota_core/* ################################################################################# # How to solidify (needs an ESP32 with PSRAM) #- import path -path.remove("openhasp.bec") +path.remove("haspmota.bec") import solidify -var openhasp -load('openhasp.be') +var haspmota +load('haspmota.be') var classes = [ "page", "obj", "scr", @@ -23,12 +23,12 @@ var classes = [ "qrcode" ] for c:classes - solidify.dump(openhasp.OpenHASP.("lvh_"+c), true) + solidify.dump(haspmota.HASPmota.("lvh_"+c), true) end -solidify.dump(openhasp, true) +solidify.dump(haspmota, true) -# -var openhasp = module("openhasp") +var haspmota = module("haspmota") ################################################################################# ################################################################################# @@ -37,7 +37,7 @@ var openhasp = module("openhasp") # Provide a mapping for virtual members # Stores the associated page and object id # -# Adds specific virtual members used by OpenHASP +# Adds specific virtual members used by HASPmota ################################################################################# ################################################################################# class lvh_obj @@ -62,7 +62,7 @@ class lvh_obj # and the Berry or LVGL attribute to set # # We try to map directly an attribute to the LVGL - # Ex: OpenHASP attribute `w` is mapped to LVGL `width` + # Ex: HASPmota attribute `w` is mapped to LVGL `width` # # If mapping is null, we use set_X and get_X from our own class static _attr_map = { @@ -150,7 +150,7 @@ class lvh_obj var _lv_obj # native lvgl object var _lv_label # sub-label if exists var _page # parent page object - var _action # value of the OpenHASP `action` attribute, shouldn't be called `self.action` since we want to trigger the set/member functions + var _action # value of the HASPmota `action` attribute, shouldn't be called `self.action` since we want to trigger the set/member functions #==================================================================== # Rule engine to map value and text to rules @@ -242,10 +242,10 @@ class lvh_obj end #==================================================================== - # init OpenHASP object from its jsonl definition + # init HASPmota object from its jsonl definition # # arg1: LVGL parent object (used to create a sub-object) - # arg2: `jline` JSONL definition of the object from OpenHASP template (used in sub-classes) + # arg2: `jline` JSONL definition of the object from HASPmota template (used in sub-classes) # arg3: (opt) LVGL object if it already exists and was created prior to init() #==================================================================== def init(parent, page, jline, obj) @@ -323,7 +323,7 @@ class lvh_obj # the callback avoids doing anything sophisticated in the cb # defer the actual action to the Tasmota event loop # print("-> CB fired","self",self,"obj",obj,"event",event.tomap(),"code",event.code) - var oh = self._page._oh # openhasp global object + var oh = self._page._oh # haspmota global object var code = event.code # materialize to a local variable, otherwise the value can change (and don't capture event object) if self.action != "" && code == lv.EVENT_CLICKED # if clicked and action is declared, do the page change event @@ -507,7 +507,7 @@ class lvh_obj #==================================================================== # `text_font` # - # For OpenHASP compatiblity, default to "robotocondensed-latin1" + # For HASPmota compatiblity, default to "robotocondensed-latin1" # However we propose an extension to allow for other font names # # Arg1: (int) font size for `robotocondensed-latin1` @@ -1104,7 +1104,7 @@ class lvh_dropdown : lvh_obj end end - # direction needs a conversion from OpenHASP numbers and LVGL's + # direction needs a conversion from HASPmota numbers and LVGL's def set_direction(t) # 0 = down, 1 = up, 2 = left, 3 = right self._lv_obj.set_dir(self._dir[int(t)]) @@ -1119,7 +1119,7 @@ class lvh_dropdown : lvh_obj return -1 end - # show_selected (bool) is a OpenHASP addition + # show_selected (bool) is a HASPmota addition # only meaningful if set to `true`, setting to false requires a call to `set_text` def set_show_selected(t) if t @@ -1159,22 +1159,22 @@ class lvh_page var _obj_id # (map) of `lvh_obj` objects by id numbers var _page_id # (int) id number of this page var _lv_scr # (lv_obj) lvgl screen object - var _oh # OpenHASP global object - # openhasp attributes for page are on item `#0` + var _oh # HASPmota global object + # haspmota attributes for page are on item `#0` var prev, next, back # (int) id values for `prev`, `next`, `back` buttons #==================================================================== # `init` # - # arg1: `page_number` (int) OpenHASP page id + # arg1: `page_number` (int) HASPmota page id # defaults to `1` if not specified # page 0 is special, visible on all pages. Internally uses `layer_top` - # arg2: `oh` global OpenHASP monad object - # page_number: openhasp page number, defaults to `1` if not specified + # arg2: `oh` global HASPmota monad object + # page_number: haspmota page number, defaults to `1` if not specified #==================================================================== def init(page_number, oh) import global - self._oh = oh # memorize OpenHASP parent object + self._oh = oh # memorize HASPmota parent object # if no parameter, default to page #1 page_number = int(page_number) @@ -1283,17 +1283,17 @@ end ################################################################################# # -# class `OpenHASP` to initialize the OpenHASP parsing +# class `HASPmota` to initialize the HASPmota parsing # ################################################################################# # main class controller, meant to be a singleton and the only externally used class -class OpenHASP +class HASPmota var dark # (bool) use dark theme? var hres, vres # (int) resolution var scr # (lv_obj) default LVGL screen var r16 # (lv_font) robotocondensed fonts size 16 - # openhasp objects + # haspmota objects var lvh_pages # (list of lvg_page) list of pages var lvh_page_cur_idx # (int) current page index number # regex patterns @@ -1376,8 +1376,8 @@ class OpenHASP self.r16 = lv.font_embedded("montserrat", 14) # TODO what if does not exist end - # set the theme for OpenHASP - var th2 = lv.theme_openhasp_init(0, lv.color(0xFF00FF), lv.color(0x303030), self.dark, self.r16) + # set the theme for HASPmota + var th2 = lv.theme_haspmota_init(0, lv.color(0xFF00FF), lv.color(0x303030), self.dark, self.r16) self.scr.get_disp().set_theme(th2) self.scr.set_style_bg_color(self.dark ? lv.color(0x000000) : lv.color(0xFFFFFF),0) # set background to white # apply theme to layer_top, but keep it transparent @@ -1675,7 +1675,7 @@ class OpenHASP return end - # extract openhasp class, prefix with `lvh_`. Ex: `btn` becomes `lvh_btn` + # extract haspmota class, prefix with `lvh_`. Ex: `btn` becomes `lvh_btn` # extract parent var parent_lvgl var parent_id = int(jline.find("parentid")) @@ -1746,20 +1746,20 @@ class OpenHASP end end end -openhasp.OpenHASP = OpenHASP +haspmota.HASPmota = HASPmota ################################################################################# # General module initilization ################################################################################# -# automatically instanciate the OpenHASP() monad +# automatically instanciate the HASPmota() monad # note: value is cached in the module cache -# and is returned whenever you call `import openhasp` again +# and is returned whenever you call `import haspmota` again # This means that the object is never garbage collected # -openhasp.init = def (m) # `init(m)` is called during first `import openhasp` - var oh = m.OpenHASP +haspmota.init = def (m) # `init(m)` is called during first `import haspmota` + var oh = m.HASPmota return oh() end -return openhasp +return haspmota diff --git a/tasmota/berry/openhasp_src/openhasp_demo.tapp b/tasmota/berry/haspmota_src/haspmota_demo.tapp similarity index 97% rename from tasmota/berry/openhasp_src/openhasp_demo.tapp rename to tasmota/berry/haspmota_src/haspmota_demo.tapp index aac2e596797e591c167663d041dd031899eec205..313b3158e03523b531a1223420d5f4f3b82a19a9 100644 GIT binary patch delta 1577 zcmZuxS!fec6rFd|*g7##QE^FZpGMnsOWi8e4eNs1Hnh?d^~ZM7jwUtj#AYIG6~qN% zD`;cT_aXS>_95aDWkkh(2%^Og!KJ7mewj2a>W>@J>dfeS)-Rcx0$vJejA<+vvp#$|1|Yytj{+XR&t8zC)Hr&vzC@#}Zp^qZ$2 zo`@`T%I+OPC?b~PxfD*GLeDK0Rehqv>dyYHFmca5J9*psG+TG{+Y6~9dCwlU>)=91 z0Ry)?dUJFz<0_>f**}O}$<^~lXO?KKDcX%vS8_Q{TUu+v!cH;bX^Ti5A=Vl-d2-9D zPqrMU%~x#!W+kq9rzPatZ6<(R%D|+==UT4`O*DHqF(7%(D#9N7^%7-I(F3BRe+4Lmqi93!1}xw3&G_DU z`DupZw563zE29&!uP^35cQodYcG)L(vTzF$uL%mlW4O~XNW2l@JLk^Fj zW9*>ynfc$y{2C^jjZ}@J3kJo9apagzeSAm~THS@zBy)bC)MRRTG#T22o}3Bu7gMwp z%biiNi08{({2rl`4Iy5M+ojfMNOZI5y15%Rqa4aY`uo7AnF%XU1%GO@EG{Hrs;GH4KFNCnu#6!&^l>4thX1B7 z$ovtgCp`EM@+Je7j7*QI9QgyO`1cae(4Twl@7#gxF=W2dR?ebcY4TtM@Pzy{s6jsg D|0+?| delta 1572 zcmZuxTWAzl7@qS_)}%8oL`?CLs0TNi&23{^BiL3^t45P78*#m~NX=|AYc@_Y%kHcs zdGLaw_@K?Y=pp!MZ3#s*Zec`9&=(0oM5!9YzG||YAf;fvw6Q%idd@i2g|p26{r~y? z`*|@gPmjwDt<7SABv`+TZG+)0@Qmw&D8Js4@fTj(9F1Jx9L3KqVBS~5Kyqjd`LgTErx#RH^0541>+hF~1;IL2RpQD%H5uqi>OGoW z70WR_*XnwKcjg;u#S~B%Zv@fts4g;qx7VDWdRkuM1oLILg&awcF&+Xo&ouO2A$^J zwFl*6bMkhAmpmFIf9`g&PZXC!o4Dg%pnhq z%8uAK2ex~;NbWBN!X-1g1e%@kFmF{s#XLv*d_BC{AeWsWIwZ|v0-dg-01v_7F#+gpng)_*#(jGyiD^2cA L0iIPd3DoF6tt~gR diff --git a/tasmota/berry/openhasp_src/openhasp_demo/autoexec.be b/tasmota/berry/haspmota_src/haspmota_demo/autoexec.be similarity index 87% rename from tasmota/berry/openhasp_src/openhasp_demo/autoexec.be rename to tasmota/berry/haspmota_src/haspmota_demo/autoexec.be index 0d3a90376..0bc19a917 100644 --- a/tasmota/berry/openhasp_src/openhasp_demo/autoexec.be +++ b/tasmota/berry/haspmota_src/haspmota_demo/autoexec.be @@ -1,5 +1,5 @@ # OpenHASP demo -# rm openhasp_demo.tapp ; zip -j -0 openhasp_demo.tapp openhasp_demo/* openhasp_core/openhasp.be +# rm haspmota_demo.tapp ; zip -j -0 haspmota_demo.tapp haspmota_demo/* haspmota_core/haspmota.be if !tasmota.memory().contains("psram") print("HSP: Error: OpenHASP demo requires PSRAM") @@ -10,8 +10,8 @@ import lv_tasmota_log import lv_tasmota_info import lv_wifi_graph -import openhasp -openhasp.start(false, "openhasp_demo.tapp#pages.jsonl") +import haspmota +haspmota.start(false, "haspmota_demo.tapp#pages.jsonl") var prev_day = -1 def set_watch() diff --git a/tasmota/berry/openhasp_src/openhasp_demo/lv_tasmota_info.be b/tasmota/berry/haspmota_src/haspmota_demo/lv_tasmota_info.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/lv_tasmota_info.be rename to tasmota/berry/haspmota_src/haspmota_demo/lv_tasmota_info.be diff --git a/tasmota/berry/openhasp_src/openhasp_demo/lv_tasmota_log.be b/tasmota/berry/haspmota_src/haspmota_demo/lv_tasmota_log.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/lv_tasmota_log.be rename to tasmota/berry/haspmota_src/haspmota_demo/lv_tasmota_log.be diff --git a/tasmota/berry/openhasp_src/openhasp_demo/lv_wifi_graph.be b/tasmota/berry/haspmota_src/haspmota_demo/lv_wifi_graph.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/lv_wifi_graph.be rename to tasmota/berry/haspmota_src/haspmota_demo/lv_wifi_graph.be diff --git a/tasmota/berry/openhasp_src/openhasp_demo/noun_Fan_35097_140.png b/tasmota/berry/haspmota_src/haspmota_demo/noun_Fan_35097_140.png similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/noun_Fan_35097_140.png rename to tasmota/berry/haspmota_src/haspmota_demo/noun_Fan_35097_140.png diff --git a/tasmota/berry/openhasp_src/openhasp_demo/pages.jsonl b/tasmota/berry/haspmota_src/haspmota_demo/pages.jsonl similarity index 92% rename from tasmota/berry/openhasp_src/openhasp_demo/pages.jsonl rename to tasmota/berry/haspmota_src/haspmota_demo/pages.jsonl index 12cd03736..701cc32c9 100644 --- a/tasmota/berry/openhasp_src/openhasp_demo/pages.jsonl +++ b/tasmota/berry/haspmota_src/haspmota_demo/pages.jsonl @@ -36,16 +36,16 @@ {"page":4,"comment":"---------- Page 4 - fan animation ----------"} {"id":0,"bg_color":"#0000A0","bg_grad_color":"#000000","bg_grad_dir":1,"text_color":"#FFFFFF"} -{"id":11,"obj":"img","src":"A:/openhasp_demo.tapp#noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":50,"image_recolor":"#0080FF","image_recolor_opa":150} +{"id":11,"obj":"img","src":"A:/haspmota_demo.tapp#noun_Fan_35097_140.png","auto_size":1,"w":140,"h":140,"x":50,"y":50,"image_recolor":"#0080FF","image_recolor_opa":150} {"id":12,"obj":"spinner","parentid":11,"x":7,"y":6,"w":126,"h":126,"bg_opa":0,"border_width":0,"line_width":7,"line_width1":7,"type":2,"angle":120,"speed":1000,"value_str":3,"value_font":24} {"page":5,"comment":"---------- Page 5 - fancy watch ----------"} {"id":0,"bg_color":"#000000","bg_grad_color":"#000000","bg_grad_dir":1,"text_color":"#000000"} -{"id":10,"obj":"img","src":"A:/openhasp_demo.tapp#watch_ren_back_240.png","x":40,"y":0,"w":240,"h":240} -{"id":11,"obj":"img","parentid":10,"src":"A:/openhasp_demo.tapp#watch_ren_hour_240.png","auto_size":1,"x":110,"y":45} -{"id":12,"obj":"img","parentid":10,"src":"A:/openhasp_demo.tapp#watch_ren_min_240.png","auto_size":1} -{"id":13,"obj":"img","parentid":10,"src":"A:/openhasp_demo.tapp#watch_ren_sec_240.png","auto_size":1,"x":110,"y":10} +{"id":10,"obj":"img","src":"A:/haspmota_demo.tapp#watch_ren_back_240.png","x":40,"y":0,"w":240,"h":240} +{"id":11,"obj":"img","parentid":10,"src":"A:/haspmota_demo.tapp#watch_ren_hour_240.png","auto_size":1,"x":110,"y":45} +{"id":12,"obj":"img","parentid":10,"src":"A:/haspmota_demo.tapp#watch_ren_min_240.png","auto_size":1} +{"id":13,"obj":"img","parentid":10,"src":"A:/haspmota_demo.tapp#watch_ren_sec_240.png","auto_size":1,"x":110,"y":10} {"id":15,"obj":"label","parentid":10,"x":184,"y":112,"w":18,"h":16,"text":"","align":1,"text_font":"montserrat-14"} diff --git a/tasmota/berry/openhasp_src/openhasp_demo/watch_ren_back_240.png b/tasmota/berry/haspmota_src/haspmota_demo/watch_ren_back_240.png similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/watch_ren_back_240.png rename to tasmota/berry/haspmota_src/haspmota_demo/watch_ren_back_240.png diff --git a/tasmota/berry/openhasp_src/openhasp_demo/watch_ren_hour_240.png b/tasmota/berry/haspmota_src/haspmota_demo/watch_ren_hour_240.png similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/watch_ren_hour_240.png rename to tasmota/berry/haspmota_src/haspmota_demo/watch_ren_hour_240.png diff --git a/tasmota/berry/openhasp_src/openhasp_demo/watch_ren_min_240.png b/tasmota/berry/haspmota_src/haspmota_demo/watch_ren_min_240.png similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/watch_ren_min_240.png rename to tasmota/berry/haspmota_src/haspmota_demo/watch_ren_min_240.png diff --git a/tasmota/berry/openhasp_src/openhasp_demo/watch_ren_sec_240.png b/tasmota/berry/haspmota_src/haspmota_demo/watch_ren_sec_240.png similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_demo/watch_ren_sec_240.png rename to tasmota/berry/haspmota_src/haspmota_demo/watch_ren_sec_240.png diff --git a/tasmota/berry/openhasp_src/openhasp_examples/demo-all.jsonl b/tasmota/berry/haspmota_src/haspmota_examples/demo-all.jsonl similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_examples/demo-all.jsonl rename to tasmota/berry/haspmota_src/haspmota_examples/demo-all.jsonl diff --git a/tasmota/berry/openhasp_src/openhasp_examples/demo1.jsonl b/tasmota/berry/haspmota_src/haspmota_examples/demo1.jsonl similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_examples/demo1.jsonl rename to tasmota/berry/haspmota_src/haspmota_examples/demo1.jsonl diff --git a/tasmota/berry/openhasp_src/openhasp_examples/demo2.jsonl b/tasmota/berry/haspmota_src/haspmota_examples/demo2.jsonl similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_examples/demo2.jsonl rename to tasmota/berry/haspmota_src/haspmota_examples/demo2.jsonl diff --git a/tasmota/berry/openhasp_src/openhasp_examples/demo3.jsonl b/tasmota/berry/haspmota_src/haspmota_examples/demo3.jsonl similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_examples/demo3.jsonl rename to tasmota/berry/haspmota_src/haspmota_examples/demo3.jsonl diff --git a/tasmota/berry/openhasp_src/openhasp_examples/lv.jsonl b/tasmota/berry/haspmota_src/haspmota_examples/lv.jsonl similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_examples/lv.jsonl rename to tasmota/berry/haspmota_src/haspmota_examples/lv.jsonl diff --git a/tasmota/berry/openhasp_src/openhasp_widgets.tapp b/tasmota/berry/haspmota_src/haspmota_widgets.tapp similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_widgets.tapp rename to tasmota/berry/haspmota_src/haspmota_widgets.tapp diff --git a/tasmota/berry/openhasp_src/openhasp_widgets/autoexec.be b/tasmota/berry/haspmota_src/haspmota_widgets/autoexec.be similarity index 64% rename from tasmota/berry/openhasp_src/openhasp_widgets/autoexec.be rename to tasmota/berry/haspmota_src/haspmota_widgets/autoexec.be index edada704e..e174a8098 100644 --- a/tasmota/berry/openhasp_src/openhasp_widgets/autoexec.be +++ b/tasmota/berry/haspmota_src/haspmota_widgets/autoexec.be @@ -1,6 +1,6 @@ # pre-load widgets so future `import` will be already in memory # create tapp file with: -# rm rm openhasp_widgets.tapp; zip -j -0 openhasp_widgets.tapp openhasp_widgets/* +# rm rm haspmota_widgets.tapp; zip -j -0 haspmota_widgets.tapp haspmota_widgets/* import lv_tasmota_log import lv_tasmota_info import lv_wifi_graph diff --git a/tasmota/berry/openhasp_src/openhasp_widgets/lv_tasmota_info.be b/tasmota/berry/haspmota_src/haspmota_widgets/lv_tasmota_info.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_widgets/lv_tasmota_info.be rename to tasmota/berry/haspmota_src/haspmota_widgets/lv_tasmota_info.be diff --git a/tasmota/berry/openhasp_src/openhasp_widgets/lv_tasmota_log.be b/tasmota/berry/haspmota_src/haspmota_widgets/lv_tasmota_log.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_widgets/lv_tasmota_log.be rename to tasmota/berry/haspmota_src/haspmota_widgets/lv_tasmota_log.be diff --git a/tasmota/berry/openhasp_src/openhasp_widgets/lv_wifi_graph.be b/tasmota/berry/haspmota_src/haspmota_widgets/lv_wifi_graph.be similarity index 100% rename from tasmota/berry/openhasp_src/openhasp_widgets/lv_wifi_graph.be rename to tasmota/berry/haspmota_src/haspmota_widgets/lv_wifi_graph.be diff --git a/tasmota/berry/openhasp_src/gen_openhasp.sh b/tasmota/berry/openhasp_src/gen_openhasp.sh deleted file mode 100755 index 711398637..000000000 --- a/tasmota/berry/openhasp_src/gen_openhasp.sh +++ /dev/null @@ -1,5 +0,0 @@ -# generate all openhasp tapp files -rm openhasp.tapp; zip -j -0 openhasp.tapp openhasp_core/* -rm openhasp_demo.tapp ; zip -j -0 openhasp_demo.tapp openhasp_demo/* openhasp_core/openhasp.be -cp openhasp.tapp ../openhasp -cp openhasp_demo.tapp ../openhasp diff --git a/tasmota/berry/openhasp_src/openhasp_core/autoexec.be b/tasmota/berry/openhasp_src/openhasp_core/autoexec.be deleted file mode 100644 index 7a74f523d..000000000 --- a/tasmota/berry/openhasp_src/openhasp_core/autoexec.be +++ /dev/null @@ -1,7 +0,0 @@ -# start openhasp -# package with -# rm openhasp.tapp; zip -j -0 openhasp.tapp openhasp_core/* -import openhasp - -# defer start to make sure all modules and tapp applications were loaded first -tasmota.set_timer(1000, /-> openhasp.start()) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index b28dc2184..c34edb489 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -1048,7 +1048,7 @@ // -- LVGL Graphics Library --------------------------------- //#define USE_LVGL // LVGL Engine, requires Berry (+382KB) #define USE_LVGL_PSRAM // Allocate LVGL memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact - // #define USE_LVGL_OPENHASP // Enable OpenHASP compatiblity and Robotocondensed fonts (+90KB flash) + // #define USE_LVGL_HASPMOTA // Enable OpenHASP compatiblity and Robotocondensed fonts (+90KB flash) #define USE_LVGL_MAX_SLEEP 10 // max sleep in ms when LVGL is enabled, more than 10ms will make display less responsive #define USE_LVGL_PNG_DECODER // include a PNG image decoder from file system (+16KB) //#define USE_LVGL_TOUCHSCREEN // Use virtual touch screen with Berry driver diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index eb96edc9f..e99cc9fee 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -260,7 +260,7 @@ #ifdef FIRMWARE_LVGL #undef CODE_IMAGE_STR -#define CODE_IMAGE_STR "lvgl-openhasp" +#define CODE_IMAGE_STR "lvgl-haspmota" #undef MODULE #define MODULE WEMOS // [Module] Select default module from tasmota_template.h @@ -276,7 +276,7 @@ #define USE_I2S #define USE_SPI #define USE_LVGL -#define USE_LVGL_OPENHASP +#define USE_LVGL_HASPMOTA #define USE_LVGL_FREETYPE #undef SET_ESP32_STACK_SIZE #define SET_ESP32_STACK_SIZE (24 * 1024) diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index fcd270179..56aa6e833 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -306,7 +306,7 @@ extern "C" { { "montserrat", lv_montserrat_fonts }, { "seg7", lv_seg7_fonts }, { "unscii", lv_unscii_fonts}, -#ifdef USE_LVGL_OPENHASP +#ifdef USE_LVGL_HASPMOTA { "robotocondensed", lv_robotocondensed_fonts }, #endif { nullptr, nullptr} @@ -355,9 +355,9 @@ extern "C" { } int lv0_load_robotocondensed_latin1_font(bvm *vm) { -#ifdef USE_LVGL_OPENHASP +#ifdef USE_LVGL_HASPMOTA return lv_load_embedded_font(vm, "robotocondensed", 0); -#endif // USE_LVGL_OPENHASP +#endif // USE_LVGL_HASPMOTA be_raise(vm, kTypeError, nullptr); }