mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-19 01:06:41 +00:00
Minor tweaks
This commit is contained in:
parent
8bd001ccb0
commit
303cd45a11
@ -763,6 +763,7 @@ void hasp_get_info(JsonDocument& doc)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
info = doc.createNestedObject(F(D_INFO_LVGL_MEMORY));
|
||||
lv_mem_monitor_t mem_mon;
|
||||
lv_mem_monitor(&mem_mon);
|
||||
@ -771,6 +772,7 @@ void hasp_get_info(JsonDocument& doc)
|
||||
Parser::format_bytes(mem_mon.free_size, size_buf, sizeof(size_buf));
|
||||
info[F(D_INFO_FREE_MEMORY)] = size_buf;
|
||||
info[F(D_INFO_FRAGMENTATION)] = std::to_string(mem_mon.frag_pct) + "%";
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
|
||||
/* MIT License - Copyright (c) 2019-2023 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#if HASP_USE_CONFIG > 0
|
||||
@ -147,11 +147,11 @@ DeserializationError configParseFile(String& configFile, JsonDocument& settings)
|
||||
DeserializationError result;
|
||||
|
||||
if(file) {
|
||||
size_t size = file.size();
|
||||
if(size > 1024) {
|
||||
LOG_ERROR(TAG_CONF, F("Config file size is too large"));
|
||||
return DeserializationError::NoMemory;
|
||||
}
|
||||
// size_t size = file.size();
|
||||
// if(size > 1024) {
|
||||
// LOG_ERROR(TAG_CONF, F("Config file size is too large"));
|
||||
// return DeserializationError::NoMemory;
|
||||
// }
|
||||
result = deserializeJson(settings, file);
|
||||
file.close();
|
||||
return result;
|
||||
|
@ -54,6 +54,7 @@ void timeSetup()
|
||||
#endif
|
||||
}
|
||||
|
||||
// https://github.com/nayarsystems/posix_tz_db
|
||||
String time_zone_to_possix(const char* timezone)
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
|
@ -429,7 +429,7 @@ static void wifiReconnect(void)
|
||||
|
||||
#elif defined(ARDUINO_ARCH_ESP32)
|
||||
// https://github.com/espressif/arduino-esp32/issues/3438#issuecomment-721428310
|
||||
WiFi.persistent(true);
|
||||
WiFi.persistent(false);
|
||||
WiFi.disconnect(true);
|
||||
WiFi.setHostname(haspDevice.get_hostname());
|
||||
WiFi.setSleep(false);
|
||||
@ -507,6 +507,7 @@ void wifiSetup()
|
||||
strncpy(wifiPassword, password.c_str(), sizeof(wifiPassword));
|
||||
LOG_DEBUG(TAG_WIFI, F(D_BULLET "Read %s => %s (%d bytes)"), FP_CONFIG_PASS, password.c_str(),
|
||||
password.length());
|
||||
preferences.end();
|
||||
#endif
|
||||
|
||||
wifiReconnect();
|
||||
|
@ -37,7 +37,7 @@ env.Append(
|
||||
|
||||
r = Repo('.')
|
||||
commit_hash = r.head().decode("utf-8")[0:7]
|
||||
with open("data/editor.htm", "r", encoding="utf-8") as f:
|
||||
with open("data/edit.htm", "r", encoding="utf-8") as f:
|
||||
html=f.read()
|
||||
html = html.replace("COMMIT_HASH", commit_hash)
|
||||
with gzip.open('data/static/edit.htm.gz', 'wb') as f:
|
||||
|
Loading…
x
Reference in New Issue
Block a user