mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Merge pull request #125 from arovak/user_override
Expand user_config_override-template.h with example settings and add possibility to define the build language.
This commit is contained in:
commit
63a6286029
@ -1,6 +1,10 @@
|
|||||||
#ifndef HASP_CONF_H
|
#ifndef HASP_CONF_H
|
||||||
#define HASP_CONF_H
|
#define HASP_CONF_H
|
||||||
|
|
||||||
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
|
#include "user_config_override.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// language specific defines
|
// language specific defines
|
||||||
#include "lang/lang.h"
|
#include "lang/lang.h"
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
//
|
//
|
||||||
// To use: Save a copy as user_config_override.h
|
// 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
|
#define SERIAL_SPEED 115200
|
||||||
|
|
||||||
@ -48,6 +50,19 @@
|
|||||||
#define SYSLOG_PORT 514
|
#define SYSLOG_PORT 514
|
||||||
#define APP_NAME "HASP"
|
#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
|
* Web interface coloring
|
||||||
**************************************************/
|
**************************************************/
|
||||||
@ -77,3 +92,5 @@
|
|||||||
* Other Settings
|
* Other Settings
|
||||||
**************************************************/
|
**************************************************/
|
||||||
//#define HASP_USE_HA // Enable Home Assistant auto-discovery
|
//#define HASP_USE_HA // Enable Home Assistant auto-discovery
|
||||||
|
|
||||||
|
#endif
|
@ -7,13 +7,14 @@
|
|||||||
#include <Esp.h>
|
#include <Esp.h>
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|
||||||
|
#include "hasp_conf.h"
|
||||||
|
|
||||||
#include "../device.h"
|
#include "../device.h"
|
||||||
#include "esp32.h"
|
#include "esp32.h"
|
||||||
|
|
||||||
#include "driver/adc.h"
|
#include "driver/adc.h"
|
||||||
#include "esp_adc_cal.h"
|
#include "esp_adc_cal.h"
|
||||||
|
|
||||||
#include "hasp_conf.h"
|
|
||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
#include "hasp/hasp_utilities.h"
|
#include "hasp/hasp_utilities.h"
|
||||||
|
|
||||||
|
@ -15,7 +15,11 @@ class Esp32Device : public BaseDevice {
|
|||||||
public:
|
public:
|
||||||
Esp32Device()
|
Esp32Device()
|
||||||
{
|
{
|
||||||
|
#ifdef MQTT_NODENAME
|
||||||
|
_hostname = MQTT_NODENAME;
|
||||||
|
#else
|
||||||
_hostname = "plate";
|
_hostname = "plate";
|
||||||
|
#endif
|
||||||
_backlight_power = 1;
|
_backlight_power = 1;
|
||||||
_backlight_level = 100;
|
_backlight_level = 100;
|
||||||
#ifdef TFT_BCKL
|
#ifdef TFT_BCKL
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
#ifndef HASP_LANG_H
|
#ifndef HASP_LANG_H
|
||||||
#define 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
|
// language independent defines
|
||||||
#define D_PASSWORD_MASK "********"
|
#define D_PASSWORD_MASK "********"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#define D_SSID "Ssid:"
|
#define D_SSID "Ssid:"
|
||||||
|
|
||||||
#define D_ERROR_OUT_OF_MEMORY "Geen geheugen bechikbaar"
|
#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_NOT_CHANGED "Instellingen ongewijzigd"
|
||||||
#define D_CONFIG_CHANGED "Instellingen gewijzigd"
|
#define D_CONFIG_CHANGED "Instellingen gewijzigd"
|
||||||
@ -51,7 +51,6 @@
|
|||||||
#define D_TELNET_CLOSING_CONNECTION "Sessie sluiten van %s"
|
#define D_TELNET_CLOSING_CONNECTION "Sessie sluiten van %s"
|
||||||
#define D_TELNET_CLIENT_LOGIN_FROM "Client aangemeld 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_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_AUTHENTICATION_FAILED "Autorisatie mislukt!"
|
||||||
#define D_TELNET_INCORRECT_LOGIN_ATTEMPT "Aanmelding van %s mislukt"
|
#define D_TELNET_INCORRECT_LOGIN_ATTEMPT "Aanmelding van %s mislukt"
|
||||||
#define D_TELNET_STARTED "Telnet console gestart"
|
#define D_TELNET_STARTED "Telnet console gestart"
|
||||||
@ -125,7 +124,7 @@
|
|||||||
#define D_HTTP_REBOOT "Herstarten"
|
#define D_HTTP_REBOOT "Herstarten"
|
||||||
#define D_HTTP_CONFIGURATION "Configuratie"
|
#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"
|
#define D_OOBE_SCAN_TO_CONNECT "Scan code"
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -39,9 +39,9 @@
|
|||||||
#include "hasp/hasp_dispatch.h"
|
#include "hasp/hasp_dispatch.h"
|
||||||
#include "hasp/hasp.h"
|
#include "hasp/hasp.h"
|
||||||
|
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
// #ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
// #include "user_config_override.h"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef SERIAL_SPEED
|
#ifndef SERIAL_SPEED
|
||||||
#define SERIAL_SPEED 115200
|
#define SERIAL_SPEED 115200
|
||||||
|
@ -42,9 +42,9 @@ EthernetClient mqttNetworkClient;
|
|||||||
|
|
||||||
#include "../hasp/hasp_dispatch.h"
|
#include "../hasp/hasp_dispatch.h"
|
||||||
|
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
// #ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
// #include "user_config_override.h"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
char mqttNodeTopic[24];
|
char mqttNodeTopic[24];
|
||||||
char mqttGroupTopic[24];
|
char mqttGroupTopic[24];
|
||||||
|
@ -3,12 +3,9 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
// #ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
// #include "user_config_override.h"
|
||||||
#endif
|
// #endif
|
||||||
#ifndef MYTZ
|
|
||||||
#define MYTZ "EST5EDT,M3.2.0/2,M11.1.0"
|
|
||||||
#endif
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "ArduinoLog.h"
|
#include "ArduinoLog.h"
|
||||||
|
|
||||||
@ -20,6 +17,10 @@
|
|||||||
#include "hasp/hasp.h"
|
#include "hasp/hasp.h"
|
||||||
#include "sys/svc/hasp_mdns.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
|
#if HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0
|
||||||
void networkStart(void)
|
void networkStart(void)
|
||||||
{
|
{
|
||||||
|
@ -34,9 +34,9 @@ SPIClass espSPI(ESPSPI_MOSI, ESPSPI_MISO, ESPSPI_SCLK); // SPI port where esp is
|
|||||||
#endif
|
#endif
|
||||||
//#include "DNSserver.h"
|
//#include "DNSserver.h"
|
||||||
|
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
// #ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
// #include "user_config_override.h"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifdef WIFI_SSID
|
#ifdef WIFI_SSID
|
||||||
char wifiSsid[32] = WIFI_SSID;
|
char wifiSsid[32] = WIFI_SSID;
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
#if HASP_USE_HTTP > 0
|
#if HASP_USE_HTTP > 0
|
||||||
|
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
// #ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
// #include "user_config_override.h"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
//default theme
|
//default theme
|
||||||
#ifndef D_HTTP_COLOR_TEXT
|
#ifndef D_HTTP_COLOR_TEXT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user