mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-25 14:56:11 +02:00
parent
48594c565a
commit
308dc064fe
6 changed files with 17 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## 0.7.13 - 2023-07-19
|
## 0.7.13 - 2023-07-19
|
||||||
* merged display PR #1027
|
* merged display PR #1027
|
||||||
|
* add date, time and version to export json #1024
|
||||||
|
|
||||||
## 0.7.12 - 2023-07-09
|
## 0.7.12 - 2023-07-09
|
||||||
* added inverter status - state-machine #1016
|
* added inverter status - state-machine #1016
|
||||||
|
|
|
@ -330,7 +330,7 @@ void app::tickMinute(void) {
|
||||||
// only triggered if 'reset values on no avail is enabled'
|
// only triggered if 'reset values on no avail is enabled'
|
||||||
|
|
||||||
zeroIvValues(true);
|
zeroIvValues(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::tickMidnight(void) {
|
void app::tickMidnight(void) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ lib_deps =
|
||||||
https://github.com/yubox-node-org/ESPAsyncWebServer
|
https://github.com/yubox-node-org/ESPAsyncWebServer
|
||||||
nrf24/RF24 @ 1.4.5
|
nrf24/RF24 @ 1.4.5
|
||||||
paulstoffregen/Time @ ^1.6.1
|
paulstoffregen/Time @ ^1.6.1
|
||||||
https://github.com/bertmelis/espMqttClient#v1.4.4
|
https://github.com/bertmelis/espMqttClient#v1.4.2
|
||||||
bblanchon/ArduinoJson @ ^6.21.2
|
bblanchon/ArduinoJson @ ^6.21.2
|
||||||
https://github.com/JChristensen/Timezone @ ^1.2.4
|
https://github.com/JChristensen/Timezone @ ^1.2.4
|
||||||
olikraus/U8g2 @ ^2.34.17
|
olikraus/U8g2 @ ^2.34.17
|
||||||
|
|
|
@ -41,6 +41,15 @@ namespace ah {
|
||||||
return String(str);
|
return String(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getDateTimeStrFile(time_t t) {
|
||||||
|
char str[20];
|
||||||
|
if(0 == t)
|
||||||
|
sprintf(str, "na");
|
||||||
|
else
|
||||||
|
sprintf(str, "%04d-%02d-%02d_%02d-%02d-%02d", year(t), month(t), day(t), hour(t), minute(t), second(t));
|
||||||
|
return String(str);
|
||||||
|
}
|
||||||
|
|
||||||
String getTimeStr(time_t t) {
|
String getTimeStr(time_t t) {
|
||||||
char str[9];
|
char str[9];
|
||||||
if(0 == t)
|
if(0 == t)
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace ah {
|
||||||
void ip2Char(uint8_t ip[], char *str);
|
void ip2Char(uint8_t ip[], char *str);
|
||||||
double round3(double value);
|
double round3(double value);
|
||||||
String getDateTimeStr(time_t t);
|
String getDateTimeStr(time_t t);
|
||||||
|
String getDateTimeStrFile(time_t t);
|
||||||
String getTimeStr(time_t t);
|
String getTimeStr(time_t t);
|
||||||
uint64_t Serial2u64(const char *val);
|
uint64_t Serial2u64(const char *val);
|
||||||
void dumpBuf(uint8_t buf[], uint8_t len);
|
void dumpBuf(uint8_t buf[], uint8_t len);
|
||||||
|
|
|
@ -184,9 +184,12 @@ class RestApi {
|
||||||
response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp);
|
response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String filename = ah::getDateTimeStrFile(mApp->getTimezoneOffset());
|
||||||
|
filename += "_v" + String(mApp->getVersion());
|
||||||
|
|
||||||
response->addHeader("Content-Type", "application/octet-stream");
|
response->addHeader("Content-Type", "application/octet-stream");
|
||||||
response->addHeader("Content-Description", "File Transfer");
|
response->addHeader("Content-Description", "File Transfer");
|
||||||
response->addHeader("Content-Disposition", "attachment; filename=ahoy_setup.json");
|
response->addHeader("Content-Disposition", "attachment; filename=" + filename + "_ahoy_setup.json");
|
||||||
request->send(response);
|
request->send(response);
|
||||||
fp.close();
|
fp.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue