diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 98554c24..0cc018be 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -6,9 +6,6 @@ #endif #include "ArduinoJson.h" -#include "hasp_conf.h" - -#include "dev/device.h" #if HASP_USE_EEPROM > 0 #include "StreamUtils.h" // For EEPromStream @@ -28,13 +25,11 @@ //#include "hasp_filesystem.h" included in hasp_conf.h #endif -#include "hasp_object.h" -#include "hasp_dispatch.h" - -#include "hasp_attribute.h" -#include "hasp.h" +#include "hasplib.h" #include "lv_theme_hasp.h" +#include "dev/device.h" + #if HASP_USE_EEPROM > 0 #include "EEPROM.h" #endif diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index f8752c82..55eb8770 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -4,14 +4,7 @@ #include //#include "ArduinoLog.h" -#include "hasp_conf.h" - -#include "hasp_dispatch.h" -#include "hasp_object.h" -#include "hasp.h" -#include "hasp_utilities.h" -#include "hasp_parser.h" -#include "hasp_attribute.h" +#include "hasplib.h" #include "dev/device.h" @@ -652,13 +645,13 @@ void dispatch_parse_json(const char*, const char* payload) uint8_t savedPage = haspGetPage(); hasp_new_object(json.as(), savedPage); -#ifdef ARDUINO - } else if(json.is()) { // handle json as a single command - dispatch_text_line(json.as().c_str()); -#else + // #ifdef ARDUINO + // } else if(json.is()) { // handle json as a single command + // dispatch_text_line(json.as().c_str()); + // #else } else if(json.is()) { // handle json as a single command dispatch_text_line(json.as().c_str()); -#endif + // #endif } else if(json.is()) { // handle json as a single command dispatch_text_line(json.as()); @@ -937,7 +930,7 @@ void dispatch_output_statusupdate(const char*, const char*) #endif snprintf_P(buffer, sizeof(buffer), PSTR("\"tftDriver\":\"%s\",\"tftWidth\":%u,\"tftHeight\":%u}"), - haspDevice.get_display_driver(), (TFT_WIDTH), (TFT_HEIGHT)); + Utilities::tft_driver_name().c_str(), (TFT_WIDTH), (TFT_HEIGHT)); strcat(data, buffer); } mqtt_send_state(F("statusupdate"), data); diff --git a/src/hasp/hasp_object.cpp b/src/hasp/hasp_object.cpp index 6fa91a78..46610f2e 100644 --- a/src/hasp/hasp_object.cpp +++ b/src/hasp/hasp_object.cpp @@ -22,12 +22,7 @@ #include "../lv_components.h" #endif -#include "hasp.h" -#include "hasp_object.h" -#include "hasp_dispatch.h" -#include "hasp_attribute.h" -#include "hasp_utilities.h" -#include "hasp_parser.h" +#include "hasplib.h" const char** btnmatrix_default_map; // memory pointer to lvgl default btnmatrix map // static unsigned long last_change_event = 0; diff --git a/src/hasp/hasp_parser.cpp b/src/hasp/hasp_parser.cpp index 6742b1f7..10336a42 100644 --- a/src/hasp/hasp_parser.cpp +++ b/src/hasp/hasp_parser.cpp @@ -8,10 +8,8 @@ #endif #include "lvgl.h" -#include "hasp_conf.h" -#include "hasp_parser.h" -#include "hasp_utilities.h" +#include "hasplib.h" bool Parser::haspPayloadToColor(const char* payload, lv_color32_t& color) { diff --git a/src/hasp/hasp_utilities.cpp b/src/hasp/hasp_utilities.cpp index fd39dc09..5ae92422 100644 --- a/src/hasp/hasp_utilities.cpp +++ b/src/hasp/hasp_utilities.cpp @@ -6,7 +6,6 @@ #endif #include "hasp_conf.h" - #include "hasp_utilities.h" /* 16-bit hashing function http://www.cse.yorku.ca/~oz/hash.html */ diff --git a/src/hasplib.h b/src/hasplib.h new file mode 100644 index 00000000..8f1596e9 --- /dev/null +++ b/src/hasplib.h @@ -0,0 +1,10 @@ +#include "hasp_conf.h" + +#include "hasp/hasp.h" +#include "hasp/hasp_attribute.h" +#include "hasp/hasp_dispatch.h" +#include "hasp/hasp_object.h" +#include "hasp/hasp_parser.h" +#include "hasp/hasp_utilities.h" + +#include "hasp/lv_theme_hasp.h" \ No newline at end of file