Commit aab7df5d authored by Eric Duminil's avatar Eric Duminil
Browse files

Done

parent e588950d
Pipeline #5834 passed with stage
in 2 minutes and 31 seconds
...@@ -130,9 +130,9 @@ namespace web_config { ...@@ -130,9 +130,9 @@ namespace web_config {
TextTParameter<STRING_LEN> ntpServerParam = TextTParameter<STRING_LEN> ntpServerParam =
Builder<TextTParameter<STRING_LEN>>("ntp_server").label("NTP Server").defaultValue(NTP_SERVER).build(); Builder<TextTParameter<STRING_LEN>>("ntp_server").label("NTP Server").defaultValue(NTP_SERVER).build();
IntTParameter<int16_t> timeOffsetParam = Builder<IntTParameter<int16_t>>("timezone").label("Timezone").defaultValue( IntTParameter<int16_t> timeOffsetParam = Builder<IntTParameter<int16_t>>("timezone").label("Timezone").defaultValue(
UTC_OFFSET).min(-23).max(23).step(1).placeholder("[h]").build(); UTC_OFFSET).min(-23).max(23).step(1).placeholder("[h]").build();
CheckboxTParameter dstParam = Builder<CheckboxTParameter>("dst").label("Daylight Saving Time?").defaultValue( CheckboxTParameter dstParam = Builder<CheckboxTParameter>("dst").label("Daylight Saving Time?").defaultValue(
DAYLIGHT_SAVING_TIME).build(); DAYLIGHT_SAVING_TIME).build();
/** /**
* LoRaWAN * LoRaWAN
...@@ -149,7 +149,6 @@ namespace web_config { ...@@ -149,7 +149,6 @@ namespace web_config {
LORAWAN_APPLICATION_EUI).build(); LORAWAN_APPLICATION_EUI).build();
TextTParameter<33> appKeyParam = Builder<TextTParameter<33>>("app_key").label("App key (MSB)").defaultValue( TextTParameter<33> appKeyParam = Builder<TextTParameter<33>>("app_key").label("App key (MSB)").defaultValue(
LORAWAN_APPLICATION_KEY).build(); LORAWAN_APPLICATION_KEY).build();
#endif #endif
OptionalGroupHtmlFormatProvider optionalGroupHtmlFormatProvider; OptionalGroupHtmlFormatProvider optionalGroupHtmlFormatProvider;
...@@ -172,7 +171,7 @@ namespace web_config { ...@@ -172,7 +171,7 @@ namespace web_config {
} }
void initialize() { void initialize() {
iotWebConf = new IotWebConf(ampel.sensorId, &dnsServer, &http, AMPEL_PASSWORD, config_version); iotWebConf = new IotWebConf(ampel.sensorId, &dnsServer, &http, "", config_version);
iotWebConf->setHtmlFormatProvider(&optionalGroupHtmlFormatProvider); iotWebConf->setHtmlFormatProvider(&optionalGroupHtmlFormatProvider);
...@@ -182,6 +181,10 @@ namespace web_config { ...@@ -182,6 +181,10 @@ namespace web_config {
iotWebConf->getThingNameParameter()->label = "Ampel name"; iotWebConf->getThingNameParameter()->label = "Ampel name";
iotWebConf->getApPasswordParameter()->label = "Ampel password (user : 'admin')"; iotWebConf->getApPasswordParameter()->label = "Ampel password (user : 'admin')";
iotWebConf->getApPasswordParameter()->defaultValue = AMPEL_PASSWORD;
iotWebConf->getWifiSsidParameter()->defaultValue = WIFI_SSID;
iotWebConf->getWifiPasswordParameter()->defaultValue = WIFI_PASSWORD;
co2Params.addItem(&timestepParam); co2Params.addItem(&timestepParam);
co2Params.addItem(&temperatureOffsetParam); co2Params.addItem(&temperatureOffsetParam);
co2Params.addItem(&altitudeParam); co2Params.addItem(&altitudeParam);
...@@ -257,14 +260,10 @@ namespace web_config { ...@@ -257,14 +260,10 @@ namespace web_config {
iotWebConf->skipApStartup(); iotWebConf->skipApStartup();
//TODO: Add callbacks //TODO: Add callbacks
//TODO: Add default values for SSID/password
//TODO: Save LoRaWAN key if possible? //TODO: Save LoRaWAN key if possible?
iotWebConf->init(); iotWebConf->init();
//TODO: Authenticate only if required?
//TODO: / captive fast return?
http.on("/config", [] { http.on("/config", [] {
iotWebConf->handleConfig(); iotWebConf->handleConfig();
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment