mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-14 06:46:38 +00:00
Fix dependencies and typos
This commit is contained in:
parent
02dcb4ff9d
commit
046d4f3ec6
@ -107,10 +107,11 @@
|
|||||||
#if HASP_USE_LITTLEFS > 0
|
#if HASP_USE_LITTLEFS > 0
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include "LITTLEFS.h"
|
#include "LITTLEFS.h"
|
||||||
#endif
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
#include <FS.h> // Include the FS library
|
#include <FS.h> // Include the FS library
|
||||||
#include "hasp_filesystem.h"
|
#include "hasp_filesystem.h"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
||||||
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
@ -185,7 +185,11 @@ typedef void* lv_fs_drv_user_data_t;
|
|||||||
#if LV_USE_FS_IF
|
#if LV_USE_FS_IF
|
||||||
# define LV_FS_IF_FATFS '\0'
|
# define LV_FS_IF_FATFS '\0'
|
||||||
# define LV_FS_IF_PC '\0'
|
# define LV_FS_IF_PC '\0'
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||||
# define LV_FS_IF_SPIFFS 'E' // internal esp Flash
|
# define LV_FS_IF_SPIFFS 'E' // internal esp Flash
|
||||||
|
#else
|
||||||
|
# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
|
||||||
|
#endif
|
||||||
#endif /*LV_USE_FS_IF*/
|
#endif /*LV_USE_FS_IF*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -580,8 +580,8 @@ void haspLoadPage(const char * pages)
|
|||||||
#if HASP_USE_EEPROM > 0
|
#if HASP_USE_EEPROM > 0
|
||||||
Log.notice(TAG_HASP, F("Loading jsonl from EEPROM..."));
|
Log.notice(TAG_HASP, F("Loading jsonl from EEPROM..."));
|
||||||
EepromStream eepromStream(4096, 1024);
|
EepromStream eepromStream(4096, 1024);
|
||||||
dispatchJsonl(eepromStream);
|
dispatch_parse_jsonl(eepromStream);
|
||||||
Log.tr(TAG_HASP, F("Loaded jsonl from EEPROM"));
|
Log.trace(TAG_HASP, F("Loaded jsonl from EEPROM"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,7 +59,6 @@ void haspSetPage(uint8_t id);
|
|||||||
uint8_t haspGetPage();
|
uint8_t haspGetPage();
|
||||||
void haspClearPage(uint16_t pageid);
|
void haspClearPage(uint16_t pageid);
|
||||||
|
|
||||||
String haspGetNodename();
|
|
||||||
void haspGetVersion(char* version,size_t len);
|
void haspGetVersion(char* version,size_t len);
|
||||||
void haspBackground(uint16_t pageid, uint16_t imageid);
|
void haspBackground(uint16_t pageid, uint16_t imageid);
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
#include "hasp_object.h"
|
#include "hasp_object.h"
|
||||||
#include "hasp_gui.h"
|
#include "hasp_gui.h"
|
||||||
#include "hasp_oobe.h"
|
#include "hasp_oobe.h"
|
||||||
|
#include "hasp_mqtt.h"
|
||||||
|
#include "hasp_gpio.h"
|
||||||
#include "hasp_hal.h"
|
#include "hasp_hal.h"
|
||||||
#include "hasp.h"
|
#include "hasp.h"
|
||||||
|
|
||||||
@ -30,6 +32,8 @@ bool is_true(const char * s)
|
|||||||
|
|
||||||
void dispatch_screenshot(const char *, const char * filename)
|
void dispatch_screenshot(const char *, const char * filename)
|
||||||
{
|
{
|
||||||
|
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
||||||
|
|
||||||
if(strlen(filename) == 0) { // no filename given
|
if(strlen(filename) == 0) { // no filename given
|
||||||
char tempfile[32];
|
char tempfile[32];
|
||||||
memcpy_P(tempfile, PSTR("/screenshot.bmp"), sizeof(tempfile));
|
memcpy_P(tempfile, PSTR("/screenshot.bmp"), sizeof(tempfile));
|
||||||
@ -39,12 +43,17 @@ void dispatch_screenshot(const char *, const char * filename)
|
|||||||
} else { // Valid filename
|
} else { // Valid filename
|
||||||
guiTakeScreenshot(filename);
|
guiTakeScreenshot(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
Log.warning(TAG_MSGR, "Failed to save %s, no storage", filename);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format filesystem and erase EEPROM
|
// Format filesystem and erase EEPROM
|
||||||
bool dispatch_factory_reset()
|
bool dispatch_factory_reset()
|
||||||
{
|
{
|
||||||
bool formated, erased = true;
|
bool formated = true;
|
||||||
|
bool erased = true;
|
||||||
|
|
||||||
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
||||||
formated = HASP_FS.format();
|
formated = HASP_FS.format();
|
||||||
@ -149,9 +158,12 @@ void dispatch_command(const char * topic, const char * payload)
|
|||||||
// char item[5];
|
// char item[5];
|
||||||
// memset(item, 0, sizeof(item));
|
// memset(item, 0, sizeof(item));
|
||||||
// strncpy(item, topic + 4, 4);
|
// strncpy(item, topic + 4, 4);
|
||||||
|
|
||||||
|
#if HASP_USE_MQTT > 0
|
||||||
DynamicJsonDocument settings(45);
|
DynamicJsonDocument settings(45);
|
||||||
settings[topic + 4] = payload;
|
settings[topic + 4] = payload;
|
||||||
mqttSetConfig(settings.as<JsonObject>());
|
mqttSetConfig(settings.as<JsonObject>());
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(strlen(payload) == 0) {
|
if(strlen(payload) == 0) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
#include "hasp_network.h"
|
#include "hasp_network.h"
|
||||||
|
|
||||||
#if HASP_USE_ETHERNET > 0
|
#if HASP_USE_ETHERNET > 0 && defined(ARDUINO_ARCH_ESP32)
|
||||||
|
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "ArduinoJson.h"
|
#include "ArduinoJson.h"
|
||||||
#include "ArduinoLog.h"
|
#include "ArduinoLog.h"
|
||||||
|
|
||||||
|
#include "hasp_debug.h"
|
||||||
#include "hasp_conf.h"
|
#include "hasp_conf.h"
|
||||||
#include "hasp_hal.h"
|
#include "hasp_hal.h"
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ static void mqtt_message_cb(char * topic, byte * payload, unsigned int length)
|
|||||||
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
|
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
|
||||||
snprintf_P(msg, sizeof(msg), PSTR("ON"));
|
snprintf_P(msg, sizeof(msg), PSTR("ON"));
|
||||||
|
|
||||||
bool res = mqttClient.publish(tmp_topic, msg, true);
|
/*bool res =*/ mqttClient.publish(tmp_topic, msg, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "hasp_conf.h"
|
#include "hasp_conf.h"
|
||||||
#include "hasp_hal.h"
|
#include "hasp_hal.h"
|
||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
|
#include "hasp_mdns.h"
|
||||||
#include "hasp.h"
|
#include "hasp.h"
|
||||||
|
|
||||||
#if HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0
|
#if HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user