Skip to content

Commit 5a8d827

Browse files
committed
Merge branch 'master' into max_hardware_current_set
2 parents 85a67e9 + 99f4ad1 commit 5a8d827

File tree

13 files changed

+440
-194
lines changed

13 files changed

+440
-194
lines changed

gui-tft/lock.png

1.03 KB
Loading

src/app_config.cpp

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,14 @@ String esp_hostname_default = "openevse-"+ESPAL.getShortId();
133133

134134
void config_changed(String name);
135135

136+
#ifndef CONFIG_DEFAULT_STATE_DEFAULT
137+
#define CONFIG_DEFAULT_STATE_DEFAULT CONFIG_DEFAULT_STATE
138+
#endif
139+
136140
#define CONFIG_DEFAULT_FLAGS (CONFIG_SERVICE_SNTP | \
137141
CONFIG_OCPP_AUTO_AUTH | \
138142
CONFIG_OCPP_OFFLINE_AUTH | \
139-
CONFIG_DEFAULT_STATE)
143+
CONFIG_DEFAULT_STATE_DEFAULT)
140144

141145
ConfigOptDefinition<uint32_t> flagsOpt = ConfigOptDefinition<uint32_t>(flags, CONFIG_DEFAULT_FLAGS, "flags", "f");
142146
ConfigOptDefinition<uint32_t> flagsChanged = ConfigOptDefinition<uint32_t>(flags_changed, 0, "flags_changed", "c");
@@ -165,8 +169,8 @@ ConfigOpt *opts[] =
165169
new ConfigOptDefinition<String>(time_zone, DEFAULT_TIME_ZONE, "time_zone", "tz"),
166170

167171
// Limit
168-
new ConfigOptDefinition<String>(limit_default_type, {}, "limit_default_type", "ldt"),
169-
new ConfigOptDefinition<uint32_t>(limit_default_value, {}, "limit_default_value", "ldv"),
172+
new ConfigOptDefinition<String>(limit_default_type, LIMIT_DEFAULT_TYPE_DEFAULT, "limit_default_type", "ldt"),
173+
new ConfigOptDefinition<uint32_t>(limit_default_value, LIMIT_DEFAULT_VALUE_DEFAULT, "limit_default_value", "ldv"),
170174

171175
// EMONCMS SERVER strings
172176
new ConfigOptDefinition<String>(emoncms_server, "https://data.openevse.com/emoncms", "emoncms_server", "es"),
@@ -324,16 +328,19 @@ config_load_settings()
324328
if(0 == flags_changed)
325329
{
326330
// Assume all flags that do not match the default value have changed
327-
uint32_t new_changed = (flags ^ CONFIG_DEFAULT_FLAGS) & ~CONFIG_DEFAULT_STATE;
331+
uint32_t new_changed = (flags ^ CONFIG_DEFAULT_FLAGS);
328332

333+
#if CONFIG_DEFAULT_STATE_DEFAULT != 0
329334
// Handle the default charge state differently as that was set as a default to 0 previously, but is now 1
330335
// We will assume that if set to 1 it was intentional, but if 0 we will assume it was the just the default
331336
// and not an intentinal change
337+
new_changed &= ~CONFIG_DEFAULT_STATE;
332338
if(flags != CONFIG_DEFAULT_FLAGS &&
333339
CONFIG_DEFAULT_STATE == (flags & CONFIG_DEFAULT_STATE))
334340
{
335341
new_changed |= CONFIG_DEFAULT_STATE;
336342
}
343+
#endif
337344

338345
// Save any changes
339346
if(flagsChanged.set(new_changed)) {
@@ -386,23 +393,7 @@ void config_changed(String name)
386393
ledManager.setBrightness(led_brightness);
387394
#endif
388395
} else if(name.startsWith("limit_default_")) {
389-
LimitProperties limitprops;
390-
LimitType limitType;
391-
DBUGVAR(limit_default_type);
392-
DBUGVAR((int)limit_default_value);
393-
limitType.fromString(limit_default_type.c_str());
394-
limitprops.setType(limitType);
395-
limitprops.setValue(limit_default_value);
396-
limitprops.setAutoRelease(false);
397-
if (limitType == LimitType::None) {
398-
limit.clear();
399-
DBUGLN("No limit to set");
400-
}
401-
else if (limitprops.getValue())
402-
limit.set(limitprops);
403-
DBUGLN("Limit set");
404-
DBUGVAR(limitprops.getType().toString());
405-
DBUGVAR(limitprops.getValue());
396+
limit.setDefaultLimit(limit_default_type.c_str(), limit_default_value);
406397
} else if(name == "sntp_enabled") {
407398
timeManager.setSntpEnabled(config_sntp_enabled());
408399
}

src/emonesp.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
#include "debug.h"
99
#include "profile.h"
1010

11+
// -------------------------------------------------------------------
12+
// Lock Screen Configuration
13+
// -------------------------------------------------------------------
14+
15+
// Uncomment to enable lock screen when EVSE is disabled
16+
//#define ENABLE_LOCK_SCREEN
17+
18+
// Default lock screen message displayed when EVSE is disabled
19+
#ifndef LOCK_SCREEN_MESSAGE
20+
#define LOCK_SCREEN_MESSAGE "STATION LOCKED"
21+
#endif
22+
1123
#ifdef WIFI_LED
1224
#ifndef WIFI_LED_ON_STATE
1325
#define WIFI_LED_ON_STATE LOW
@@ -89,6 +101,14 @@
89101
#define DEFAULT_TIME_ZONE "Europe/London|GMT0BST,M3.5.0/1,M10.5.0"
90102
#endif
91103

104+
#ifndef LIMIT_DEFAULT_TYPE_DEFAULT
105+
#define LIMIT_DEFAULT_TYPE_DEFAULT ""
106+
#endif
107+
108+
#ifndef LIMIT_DEFAULT_VALUE_DEFAULT
109+
#define LIMIT_DEFAULT_VALUE_DEFAULT 0
110+
#endif
111+
92112
#ifndef VOLTAGE_DEFAULT
93113
#define VOLTAGE_DEFAULT 240
94114
#endif

src/lcd_common.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,4 @@
2727
#define ARRAY_ITEMS(a) (sizeof(a) / sizeof(a[0]))
2828
#endif
2929

30-
// Message line buffer - shared across screens
31-
extern char _msg[LCD_MAX_LINES][LCD_MAX_LEN + 1];
32-
3330
#endif // __LCD_COMMON_H

src/lcd_static/lcd_gui.lock_png.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
static const char CONTENT_LOCK_PNG[] PROGMEM = {
2+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
3+
0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x08, 0x06, 0x00, 0x00, 0x00, 0x57, 0x02, 0xf9,
4+
0x87, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc3, 0x00, 0x00, 0x0e,
5+
0xc3, 0x01, 0xc7, 0x6f, 0xa8, 0x64, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
6+
0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
7+
0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x03, 0xa9, 0x49,
8+
0x44, 0x41, 0x54, 0x68, 0x81, 0xed, 0x5a, 0x5b, 0x6c, 0x0c, 0x51, 0x18, 0xfe, 0xce, 0x99, 0x99,
9+
0xdd, 0x6e, 0xb7, 0x5a, 0x6d, 0xb7, 0x17, 0x45, 0x11, 0x34, 0x92, 0xd2, 0x20, 0x4a, 0x83, 0x20,
10+
0xfa, 0x40, 0x25, 0xbc, 0x78, 0xa0, 0x5e, 0x78, 0x73, 0x49, 0xf0, 0xa4, 0x21, 0x22, 0x2e, 0x89,
11+
0x88, 0x27, 0xe2, 0xd6, 0x78, 0xf3, 0x42, 0xf1, 0x20, 0x91, 0x10, 0x6d, 0x04, 0x91, 0xb8, 0xb4,
12+
0x55, 0x89, 0x6c, 0xdd, 0xe2, 0x4e, 0xdc, 0x1a, 0xbd, 0x6e, 0x2f, 0x76, 0x76, 0x66, 0xe7, 0x78,
13+
0x10, 0x95, 0xc9, 0x98, 0xdd, 0x9d, 0xb3, 0x67, 0xac, 0xca, 0x7e, 0x6f, 0x7b, 0xfe, 0xff, 0xfc,
14+
0xdf, 0xf7, 0xed, 0xcc, 0x9c, 0xb3, 0xe7, 0x9f, 0x25, 0x8c, 0x31, 0x86, 0x11, 0x0c, 0x59, 0x64,
15+
0x31, 0xd6, 0x13, 0x82, 0x76, 0xef, 0x11, 0xf4, 0x96, 0xc7, 0x30, 0x3e, 0x76, 0x80, 0x75, 0xf5,
16+
0x01, 0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0x16,
61+
0x5b, 0x03, 0xb4, 0x20, 0xd7, 0x15, 0x2d, 0x3c, 0xa0, 0x85, 0x79, 0xf6, 0x31, 0xbb, 0x80, 0xbc,
62+
0x64, 0x8e, 0x2b, 0x62, 0x78, 0xa0, 0xc4, 0xd0, 0x62, 0x6b, 0xc0, 0xbb, 0xae, 0x06, 0xd2, 0xd4,
63+
0x52, 0x57, 0x04, 0x39, 0x81, 0x54, 0x36, 0x01, 0x9e, 0xda, 0x1a, 0xdb, 0x78, 0xcc, 0xe6, 0x2e,
64+
0x0b, 0xab, 0x88, 0x5c, 0x68, 0x82, 0x76, 0xab, 0x0d, 0x46, 0x47, 0x17, 0x60, 0x18, 0xae, 0x88,
65+
0xb4, 0x80, 0x52, 0xd0, 0xa2, 0x7c, 0x28, 0x4b, 0x2b, 0xe1, 0x59, 0xb3, 0x0c, 0xc4, 0x6b, 0xff,
66+
0x06, 0x48, 0xc8, 0x9f, 0x3d, 0x52, 0x89, 0x1f, 0x84, 0x04, 0x44, 0xbc, 0x01, 0xce, 0x27, 0xf2,
67+
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00 };
68+
static const char CONTENT_LOCK_PNG_ETAG[] PROGMEM = "2adc4e2aa7d940943c70a2bcce2e17dd05b6156d7d8b5841a86a63d816ee5d9c";

src/lcd_static/lcd_gui_static_files.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "lcd_gui.connected_png.h"
88
#include "lcd_gui.disabled_png.h"
99
#include "lcd_gui.error_png.h"
10+
#include "lcd_gui.lock_png.h"
1011
#include "lcd_gui.logo_png.h"
1112
#include "lcd_gui.no_wifi_png.h"
1213
#include "lcd_gui.not_connected_png.h"
@@ -23,6 +24,7 @@ StaticFile lcd_gui_static_files[] = {
2324
{ "/connected.png", CONTENT_CONNECTED_PNG, sizeof(CONTENT_CONNECTED_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_CONNECTED_PNG_ETAG, false },
2425
{ "/disabled.png", CONTENT_DISABLED_PNG, sizeof(CONTENT_DISABLED_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_DISABLED_PNG_ETAG, false },
2526
{ "/error.png", CONTENT_ERROR_PNG, sizeof(CONTENT_ERROR_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_ERROR_PNG_ETAG, false },
27+
{ "/lock.png", CONTENT_LOCK_PNG, sizeof(CONTENT_LOCK_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_LOCK_PNG_ETAG, false },
2628
{ "/logo.png", CONTENT_LOGO_PNG, sizeof(CONTENT_LOGO_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_LOGO_PNG_ETAG, false },
2729
{ "/no_wifi.png", CONTENT_NO_WIFI_PNG, sizeof(CONTENT_NO_WIFI_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_NO_WIFI_PNG_ETAG, false },
2830
{ "/not_connected.png", CONTENT_NOT_CONNECTED_PNG, sizeof(CONTENT_NOT_CONNECTED_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_NOT_CONNECTED_PNG_ETAG, false },

0 commit comments

Comments
 (0)