diff --git a/include/hasp_conf.h b/include/hasp_conf.h index 52d2e081..fe34ab5d 100644 --- a/include/hasp_conf.h +++ b/include/hasp_conf.h @@ -1,6 +1,10 @@ #ifndef HASP_CONF_H #define HASP_CONF_H +#ifdef USE_CONFIG_OVERRIDE +#include "user_config_override.h" +#endif + // language specific defines #include "lang/lang.h" diff --git a/include/user_config_override-template.h b/include/user_config_override-template.h index 2f1fd4a7..fd01a783 100644 --- a/include/user_config_override-template.h +++ b/include/user_config_override-template.h @@ -9,6 +9,8 @@ // // To use: Save a copy as user_config_override.h ***************************************************/ +#ifndef HASP_USER_CONFIG_OVERRIDE_H +#define HASP_USER_CONFIG_OVERRIDE_H #define SERIAL_SPEED 115200 @@ -48,6 +50,19 @@ #define SYSLOG_PORT 514 #define APP_NAME "HASP" +/*************************************************** + * Timezone Settings + **************************************************/ +#define MYTZ "CET-1CEST,M3.5.0,M10.5.0/3" // A full list with possible timezones can be found here https://gist.github.com/alwynallan/24d96091655391107939 + +/*************************************************** + * Interface Language Settings + **************************************************/ +#define HASP_LANGUAGE en_US // English +// #define HASP_LANGUAGE nl_NL // Dutch +// #define HASP_LANGUAGE hu_HU // Hungarian +// #define HASP_LANGUAGE ro_RO // Romanian + /*************************************************** * Web interface coloring **************************************************/ @@ -77,3 +92,5 @@ * Other Settings **************************************************/ //#define HASP_USE_HA // Enable Home Assistant auto-discovery + +#endif \ No newline at end of file diff --git a/src/dev/esp32/esp32.cpp b/src/dev/esp32/esp32.cpp index 837a6bad..d591a407 100644 --- a/src/dev/esp32/esp32.cpp +++ b/src/dev/esp32/esp32.cpp @@ -7,13 +7,14 @@ #include #include "esp_system.h" +#include "hasp_conf.h" + #include "../device.h" #include "esp32.h" #include "driver/adc.h" #include "esp_adc_cal.h" -#include "hasp_conf.h" #include "hasp_debug.h" #include "hasp/hasp_utilities.h" diff --git a/src/dev/esp32/esp32.h b/src/dev/esp32/esp32.h index 7c2b6797..72dde072 100644 --- a/src/dev/esp32/esp32.h +++ b/src/dev/esp32/esp32.h @@ -15,7 +15,11 @@ class Esp32Device : public BaseDevice { public: Esp32Device() { +#ifdef MQTT_NODENAME + _hostname = MQTT_NODENAME; +#else _hostname = "plate"; +#endif _backlight_power = 1; _backlight_level = 100; #ifdef TFT_BCKL diff --git a/src/lang/lang.h b/src/lang/lang.h index 1b40b78f..74b95923 100644 --- a/src/lang/lang.h +++ b/src/lang/lang.h @@ -1,7 +1,14 @@ #ifndef HASP_LANG_H #define HASP_LANG_H -#include "en_US.h" +#ifndef HASP_LANGUAGE + #include "en_US.h" +#else + #define QUOTEME(x) QUOTEME_1(x) + #define QUOTEME_1(x) #x + #define INCLUDE_FILE(x) QUOTEME(x.h) + #include INCLUDE_FILE(HASP_LANGUAGE) +#endif // language independent defines #define D_PASSWORD_MASK "********" diff --git a/src/lang/nl_NL.h b/src/lang/nl_NL.h index e2b26fc7..514b2029 100644 --- a/src/lang/nl_NL.h +++ b/src/lang/nl_NL.h @@ -6,7 +6,7 @@ #define D_SSID "Ssid:" #define D_ERROR_OUT_OF_MEMORY "Geen geheugen bechikbaar" -#define D_ERROR_UNKNOWN "Unbekende fout" +#define D_ERROR_UNKNOWN "Onbekende fout" #define D_CONFIG_NOT_CHANGED "Instellingen ongewijzigd" #define D_CONFIG_CHANGED "Instellingen gewijzigd" @@ -51,7 +51,6 @@ #define D_TELNET_CLOSING_CONNECTION "Sessie sluiten van %s" #define D_TELNET_CLIENT_LOGIN_FROM "Client aangemeld van %s" #define D_TELNET_CLIENT_CONNECT_FROM "Client verbonden van %s" -#define D_TELNET_CLIENT_NOT_CONNECTED "Client NIET vzebonden" #define D_TELNET_AUTHENTICATION_FAILED "Autorisatie mislukt!" #define D_TELNET_INCORRECT_LOGIN_ATTEMPT "Aanmelding van %s mislukt" #define D_TELNET_STARTED "Telnet console gestart" @@ -125,7 +124,7 @@ #define D_HTTP_REBOOT "Herstarten" #define D_HTTP_CONFIGURATION "Configuratie" -#define D_OOBE_MSB "Raak het scherm aan om WiFi in te stellen of meld je aan op AP:" +#define D_OOBE_MSG "Raak het scherm aan om WiFi in te stellen of meld je aan op AP:" #define D_OOBE_SCAN_TO_CONNECT "Scan code" #endif \ No newline at end of file diff --git a/src/log/hasp_debug.cpp b/src/log/hasp_debug.cpp index f30989fc..a2c7071f 100644 --- a/src/log/hasp_debug.cpp +++ b/src/log/hasp_debug.cpp @@ -39,9 +39,9 @@ #include "hasp/hasp_dispatch.h" #include "hasp/hasp.h" -#ifdef USE_CONFIG_OVERRIDE -#include "user_config_override.h" -#endif +// #ifdef USE_CONFIG_OVERRIDE +// #include "user_config_override.h" +// #endif #ifndef SERIAL_SPEED #define SERIAL_SPEED 115200 diff --git a/src/mqtt/hasp_mqtt_pubsubclient.cpp b/src/mqtt/hasp_mqtt_pubsubclient.cpp index fd681b42..791387de 100644 --- a/src/mqtt/hasp_mqtt_pubsubclient.cpp +++ b/src/mqtt/hasp_mqtt_pubsubclient.cpp @@ -42,9 +42,9 @@ EthernetClient mqttNetworkClient; #include "../hasp/hasp_dispatch.h" -#ifdef USE_CONFIG_OVERRIDE -#include "user_config_override.h" -#endif +// #ifdef USE_CONFIG_OVERRIDE +// #include "user_config_override.h" +// #endif char mqttNodeTopic[24]; char mqttGroupTopic[24]; diff --git a/src/sys/net/hasp_network.cpp b/src/sys/net/hasp_network.cpp index ba6dd8b0..bdbc49c0 100644 --- a/src/sys/net/hasp_network.cpp +++ b/src/sys/net/hasp_network.cpp @@ -3,12 +3,9 @@ #include #include -#ifdef USE_CONFIG_OVERRIDE -#include "user_config_override.h" -#endif -#ifndef MYTZ -#define MYTZ "EST5EDT,M3.2.0/2,M11.1.0" -#endif +// #ifdef USE_CONFIG_OVERRIDE +// #include "user_config_override.h" +// #endif #include #include "ArduinoLog.h" @@ -20,6 +17,10 @@ #include "hasp/hasp.h" #include "sys/svc/hasp_mdns.h" +#ifndef MYTZ +#define MYTZ "EST5EDT,M3.2.0/2,M11.1.0" +#endif + #if HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0 void networkStart(void) { diff --git a/src/sys/net/hasp_wifi.cpp b/src/sys/net/hasp_wifi.cpp index 5746a0a2..c5317871 100644 --- a/src/sys/net/hasp_wifi.cpp +++ b/src/sys/net/hasp_wifi.cpp @@ -34,9 +34,9 @@ SPIClass espSPI(ESPSPI_MOSI, ESPSPI_MISO, ESPSPI_SCLK); // SPI port where esp is #endif //#include "DNSserver.h" -#ifdef USE_CONFIG_OVERRIDE -#include "user_config_override.h" -#endif +// #ifdef USE_CONFIG_OVERRIDE +// #include "user_config_override.h" +// #endif #ifdef WIFI_SSID char wifiSsid[32] = WIFI_SSID; diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index 37689bca..ca90ff14 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -26,9 +26,9 @@ #if HASP_USE_HTTP > 0 -#ifdef USE_CONFIG_OVERRIDE -#include "user_config_override.h" -#endif +// #ifdef USE_CONFIG_OVERRIDE +// #include "user_config_override.h" +// #endif //default theme #ifndef D_HTTP_COLOR_TEXT