mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-22 18:56:34 +00:00
Add hasplib
This commit is contained in:
parent
5967d137f6
commit
a115cb2b9b
@ -6,9 +6,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ArduinoJson.h"
|
#include "ArduinoJson.h"
|
||||||
#include "hasp_conf.h"
|
|
||||||
|
|
||||||
#include "dev/device.h"
|
|
||||||
|
|
||||||
#if HASP_USE_EEPROM > 0
|
#if HASP_USE_EEPROM > 0
|
||||||
#include "StreamUtils.h" // For EEPromStream
|
#include "StreamUtils.h" // For EEPromStream
|
||||||
@ -28,13 +25,11 @@
|
|||||||
//#include "hasp_filesystem.h" included in hasp_conf.h
|
//#include "hasp_filesystem.h" included in hasp_conf.h
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hasp_object.h"
|
#include "hasplib.h"
|
||||||
#include "hasp_dispatch.h"
|
|
||||||
|
|
||||||
#include "hasp_attribute.h"
|
|
||||||
#include "hasp.h"
|
|
||||||
#include "lv_theme_hasp.h"
|
#include "lv_theme_hasp.h"
|
||||||
|
|
||||||
|
#include "dev/device.h"
|
||||||
|
|
||||||
#if HASP_USE_EEPROM > 0
|
#if HASP_USE_EEPROM > 0
|
||||||
#include "EEPROM.h"
|
#include "EEPROM.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,14 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
//#include "ArduinoLog.h"
|
//#include "ArduinoLog.h"
|
||||||
#include "hasp_conf.h"
|
#include "hasplib.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 "dev/device.h"
|
#include "dev/device.h"
|
||||||
|
|
||||||
@ -652,13 +645,13 @@ void dispatch_parse_json(const char*, const char* payload)
|
|||||||
uint8_t savedPage = haspGetPage();
|
uint8_t savedPage = haspGetPage();
|
||||||
hasp_new_object(json.as<JsonObject>(), savedPage);
|
hasp_new_object(json.as<JsonObject>(), savedPage);
|
||||||
|
|
||||||
#ifdef ARDUINO
|
// #ifdef ARDUINO
|
||||||
} else if(json.is<String>()) { // handle json as a single command
|
// } else if(json.is<String>()) { // handle json as a single command
|
||||||
dispatch_text_line(json.as<String>().c_str());
|
// dispatch_text_line(json.as<String>().c_str());
|
||||||
#else
|
// #else
|
||||||
} else if(json.is<std::string>()) { // handle json as a single command
|
} else if(json.is<std::string>()) { // handle json as a single command
|
||||||
dispatch_text_line(json.as<std::string>().c_str());
|
dispatch_text_line(json.as<std::string>().c_str());
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
} else if(json.is<const char*>()) { // handle json as a single command
|
} else if(json.is<const char*>()) { // handle json as a single command
|
||||||
dispatch_text_line(json.as<const char*>());
|
dispatch_text_line(json.as<const char*>());
|
||||||
@ -937,7 +930,7 @@ void dispatch_output_statusupdate(const char*, const char*)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
snprintf_P(buffer, sizeof(buffer), PSTR("\"tftDriver\":\"%s\",\"tftWidth\":%u,\"tftHeight\":%u}"),
|
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);
|
strcat(data, buffer);
|
||||||
}
|
}
|
||||||
mqtt_send_state(F("statusupdate"), data);
|
mqtt_send_state(F("statusupdate"), data);
|
||||||
|
@ -22,12 +22,7 @@
|
|||||||
#include "../lv_components.h"
|
#include "../lv_components.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hasp.h"
|
#include "hasplib.h"
|
||||||
#include "hasp_object.h"
|
|
||||||
#include "hasp_dispatch.h"
|
|
||||||
#include "hasp_attribute.h"
|
|
||||||
#include "hasp_utilities.h"
|
|
||||||
#include "hasp_parser.h"
|
|
||||||
|
|
||||||
const char** btnmatrix_default_map; // memory pointer to lvgl default btnmatrix map
|
const char** btnmatrix_default_map; // memory pointer to lvgl default btnmatrix map
|
||||||
// static unsigned long last_change_event = 0;
|
// static unsigned long last_change_event = 0;
|
||||||
|
@ -8,10 +8,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "hasp_conf.h"
|
|
||||||
|
|
||||||
#include "hasp_parser.h"
|
#include "hasplib.h"
|
||||||
#include "hasp_utilities.h"
|
|
||||||
|
|
||||||
bool Parser::haspPayloadToColor(const char* payload, lv_color32_t& color)
|
bool Parser::haspPayloadToColor(const char* payload, lv_color32_t& color)
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hasp_conf.h"
|
#include "hasp_conf.h"
|
||||||
|
|
||||||
#include "hasp_utilities.h"
|
#include "hasp_utilities.h"
|
||||||
|
|
||||||
/* 16-bit hashing function http://www.cse.yorku.ca/~oz/hash.html */
|
/* 16-bit hashing function http://www.cse.yorku.ca/~oz/hash.html */
|
||||||
|
10
src/hasplib.h
Normal file
10
src/hasplib.h
Normal file
@ -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"
|
Loading…
x
Reference in New Issue
Block a user