Add skip key to jsonl lines to ignore the whole line

This commit is contained in:
fvanroie 2021-10-15 03:51:23 +02:00
parent 3587e8be8c
commit 5dd2c0a1d4
2 changed files with 5 additions and 0 deletions

View File

@ -225,6 +225,9 @@ static void object_add_task(lv_obj_t* obj, uint8_t pageid, uint8_t objid, lv_tas
*/
void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
{
/* Skip line detection */
if(!config[FPSTR(FP_SKIP)].isNull() && config[FPSTR(FP_SKIP)].as<bool>()) return;
/* Page selection */
uint8_t pageid = saved_page_id;
if(!config[FPSTR(FP_PAGE)].isNull()) {

View File

@ -6,6 +6,7 @@
#include "hasplib.h"
const char FP_SKIP[] PROGMEM = "skip";
const char FP_PAGE[] PROGMEM = "page";
const char FP_ID[] PROGMEM = "id";
const char FP_OBJ[] PROGMEM = "obj";
@ -62,6 +63,7 @@ enum lv_hasp_obj_type_t {
LV_HASP_ARC = 26,
LV_HASP_SPINNER = 27,
LV_HASP_CHART = 28,
LV_HASP_DATETIME = 40,
/* Selectors */
LV_HASP_DROPDOWN = 29,