From 5dd2c0a1d4d0c302ab1e0504de7c90056316b388 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Fri, 15 Oct 2021 03:51:23 +0200 Subject: [PATCH] Add skip key to jsonl lines to ignore the whole line --- src/hasp/hasp_object.cpp | 3 +++ src/hasp/hasp_object.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/hasp/hasp_object.cpp b/src/hasp/hasp_object.cpp index 9937c7e4..2abbdcf7 100644 --- a/src/hasp/hasp_object.cpp +++ b/src/hasp/hasp_object.cpp @@ -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()) return; + /* Page selection */ uint8_t pageid = saved_page_id; if(!config[FPSTR(FP_PAGE)].isNull()) { diff --git a/src/hasp/hasp_object.h b/src/hasp/hasp_object.h index 14836bb7..e218e3c2 100644 --- a/src/hasp/hasp_object.h +++ b/src/hasp/hasp_object.h @@ -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,