Added ver and build into templating
This commit is contained in:
parent
e34e73fae2
commit
437873489e
@ -240,6 +240,8 @@
|
|||||||
doc = doc.replaceAll("${corr-gravity}", cfg["gravity"]);
|
doc = doc.replaceAll("${corr-gravity}", cfg["gravity"]);
|
||||||
doc = doc.replaceAll("${angle}", cfg["angle"]);
|
doc = doc.replaceAll("${angle}", cfg["angle"]);
|
||||||
doc = doc.replaceAll("${tilt}", cfg["angle"]);
|
doc = doc.replaceAll("${tilt}", cfg["angle"]);
|
||||||
|
doc = doc.replaceAll("${app-ver}", cfg["app-ver"]);
|
||||||
|
doc = doc.replaceAll("${app-build}", cfg["app-build"]);
|
||||||
|
|
||||||
// Format in a readable json string.
|
// Format in a readable json string.
|
||||||
try {
|
try {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -130,8 +130,8 @@ void TemplatingEngine::initialize(float angle, float gravitySG,
|
|||||||
setVal(TPL_GRAVITY_CORR_P, convertToPlato(corrGravitySG), 1);
|
setVal(TPL_GRAVITY_CORR_P, convertToPlato(corrGravitySG), 1);
|
||||||
setVal(TPL_GRAVITY_UNIT, myConfig.getGravityFormat());
|
setVal(TPL_GRAVITY_UNIT, myConfig.getGravityFormat());
|
||||||
|
|
||||||
setVal(TPL_SW_VER, CFG_APPVER);
|
setVal(TPL_APP_VER, CFG_APPVER);
|
||||||
setVal(TPL_SW_REV, CFG_GITREV);
|
setVal(TPL_APP_BUILD, CFG_GITREV);
|
||||||
|
|
||||||
#if LOG_LEVEL == 6
|
#if LOG_LEVEL == 6
|
||||||
// dumpAll();
|
// dumpAll();
|
||||||
|
@ -53,8 +53,8 @@ SOFTWARE.
|
|||||||
#define TPL_GRAVITY_CORR_G "${corr-gravity-sg}"
|
#define TPL_GRAVITY_CORR_G "${corr-gravity-sg}"
|
||||||
#define TPL_GRAVITY_CORR_P "${corr-gravity-plato}"
|
#define TPL_GRAVITY_CORR_P "${corr-gravity-plato}"
|
||||||
#define TPL_GRAVITY_UNIT "${gravity-unit}" // G or P
|
#define TPL_GRAVITY_UNIT "${gravity-unit}" // G or P
|
||||||
#define TPL_SW_VER "${sw-ver}"
|
#define TPL_APP_VER "${app-ver}"
|
||||||
#define TPL_SW_REV "${sw-rev}"
|
#define TPL_APP_BUILD "${app-build}"
|
||||||
|
|
||||||
#define TPL_FNAME_HTTP1 "/http-1.tpl"
|
#define TPL_FNAME_HTTP1 "/http-1.tpl"
|
||||||
#define TPL_FNAME_HTTP2 "/http-2.tpl"
|
#define TPL_FNAME_HTTP2 "/http-2.tpl"
|
||||||
@ -75,7 +75,7 @@ class TemplatingEngine {
|
|||||||
String val;
|
String val;
|
||||||
};
|
};
|
||||||
|
|
||||||
KeyVal items[21] = {{TPL_MDNS, ""}, {TPL_ID, ""},
|
KeyVal items[23] = {{TPL_MDNS, ""}, {TPL_ID, ""},
|
||||||
{TPL_SLEEP_INTERVAL, ""}, {TPL_TEMP, ""},
|
{TPL_SLEEP_INTERVAL, ""}, {TPL_TEMP, ""},
|
||||||
{TPL_TEMP_C, ""}, {TPL_TEMP_F, ""},
|
{TPL_TEMP_C, ""}, {TPL_TEMP_F, ""},
|
||||||
{TPL_TEMP_UNITS, ""}, {TPL_BATTERY, ""},
|
{TPL_TEMP_UNITS, ""}, {TPL_BATTERY, ""},
|
||||||
@ -85,7 +85,8 @@ class TemplatingEngine {
|
|||||||
{TPL_GRAVITY_P, ""}, {TPL_GRAVITY_CORR, ""},
|
{TPL_GRAVITY_P, ""}, {TPL_GRAVITY_CORR, ""},
|
||||||
{TPL_GRAVITY_CORR_G, ""}, {TPL_GRAVITY_CORR_P, ""},
|
{TPL_GRAVITY_CORR_G, ""}, {TPL_GRAVITY_CORR_P, ""},
|
||||||
{TPL_GRAVITY_UNIT, ""}, {TPL_TOKEN, ""},
|
{TPL_GRAVITY_UNIT, ""}, {TPL_TOKEN, ""},
|
||||||
{TPL_TOKEN2, ""}};
|
{TPL_TOKEN2, ""}, {TPL_APP_VER, ""},
|
||||||
|
{TPL_APP_BUILD, ""}};
|
||||||
|
|
||||||
char buffer[20];
|
char buffer[20];
|
||||||
String baseTemplate;
|
String baseTemplate;
|
||||||
|
@ -50,6 +50,9 @@ void WebServerHandler::webHandleConfig() {
|
|||||||
doc[PARAM_PASS] = ""; // dont show the wifi password
|
doc[PARAM_PASS] = ""; // dont show the wifi password
|
||||||
doc[PARAM_PASS2] = "";
|
doc[PARAM_PASS2] = "";
|
||||||
|
|
||||||
|
doc[PARAM_APP_VER] = String(CFG_APPVER);
|
||||||
|
doc[PARAM_APP_BUILD] = String(CFG_GITREV);
|
||||||
|
|
||||||
double angle = 0;
|
double angle = 0;
|
||||||
|
|
||||||
if (myGyro.hasValue()) angle = myGyro.getAngle();
|
if (myGyro.hasValue()) angle = myGyro.getAngle();
|
||||||
|
@ -99,10 +99,10 @@ These are the format keys available for use in the format.
|
|||||||
* - ${gravity-unit}
|
* - ${gravity-unit}
|
||||||
- Gravity format, `G` or `P`
|
- Gravity format, `G` or `P`
|
||||||
- G
|
- G
|
||||||
* - ${sw-ver}
|
* - ${app-ver}
|
||||||
- Software version
|
- Software version
|
||||||
- 1.1.0
|
- 1.1.0
|
||||||
* - ${sw-rev}
|
* - ${app-build}
|
||||||
- Software revision (git hash)
|
- Software revision (git hash)
|
||||||
- ..e456743
|
- ..e456743
|
||||||
|
|
||||||
|
@ -64,5 +64,7 @@
|
|||||||
"battery": 0.04,
|
"battery": 0.04,
|
||||||
"runtime-average": 3.0,
|
"runtime-average": 3.0,
|
||||||
"ble": "pink",
|
"ble": "pink",
|
||||||
|
"app-ver": "0.1.0",
|
||||||
|
"app-build": "build",
|
||||||
"platform": "esp32"
|
"platform": "esp32"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user