Skip to content

Commit

Permalink
- Fixed const for moustache
Browse files Browse the repository at this point in the history
- Added unique MAC to SSID
  • Loading branch information
rzeldent committed Oct 7, 2023
1 parent 29d784f commit 96a577f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ auto tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT);
// Web server
DNSServer dnsServer;
WebServer server(80);
IotWebConf iotWebConf(WIFI_SSID, &dnsServer, &server, WIFI_PASSWORD, CONFIG_VERSION);
auto deviceName = String(WIFI_SSID) + "-" + String(ESP.getEfuseMac(), 16);
IotWebConf iotWebConf(deviceName.c_str(), &dnsServer, &server, WIFI_PASSWORD, CONFIG_VERSION);

auto param_group = iotwebconf::ParameterGroup("flightradar", "Flight radar");
auto iotWebParamLocation = iotwebconf::Builder<iotwebconf::TextTParameter<32>>("location").label("Location").defaultValue(DEFAULT_LOCATION).build();
Expand Down Expand Up @@ -146,7 +147,7 @@ void handleRoot()
auto latRange = String(iotWebParamLatitudeRange.value()) + "&deg; (" + (iotWebParamMetric.value() ? String(iotWebParamLatitudeRange.value() * DEGREES_TO_KM) + " km" : String(iotWebParamLatitudeRange.value() * DEGREES_TO_MI) + " mi") + ")";
auto lonRange = String(iotWebParamLongitudeRange.value()) + "&deg; (" + (iotWebParamMetric.value() ? String(iotWebParamLongitudeRange.value() * DEGREES_TO_KM) + " km" : String(iotWebParamLongitudeRange.value() * DEGREES_TO_MI) + " mi") + ")";

const moustache_variable_t substitutions[] = {
moustache_variable_t substitutions[] = {
// Version / CPU
{"AppTitle", APP_TITLE},
{"AppVersion", APP_VERSION},
Expand Down

0 comments on commit 96a577f

Please sign in to comment.