@@ -37,7 +37,6 @@ void WebPortal::setup(Entry& mqttEntry, ConfigEntry& config, NTPClient& ntpClien
37
37
38
38
void WebPortal::handleRoot () {
39
39
if (!auth ()) return ;
40
- webServer->send (200 , " text/html" , " " );
41
40
42
41
webServer->sendContent_P (HTML_MAIN1);
43
42
@@ -50,11 +49,11 @@ void WebPortal::handleRoot() {
50
49
webServer->sendContent_P (HTML_MAIN2);
51
50
52
51
webServer->sendContent_P (HTML_CONFIG_HEADER);
53
- config->each ([&](Entry* entry) {
54
- if (entry != config) {
55
- sendConfig (entry);
56
- }
57
- });
52
+ // config->each([&](Entry* entry) {
53
+ // if(entry != config) {
54
+ // sendConfig(entry);
55
+ // }
56
+ // });
58
57
59
58
webServer->sendContent_P (HTML_MAIN3);
60
59
@@ -76,6 +75,8 @@ void WebPortal::handleRoot() {
76
75
page.replace (" {device_id}" , mqtt->get (" $system" )[" deviceId" ].getValue ());
77
76
page.replace (" {topic}" , mqtt->getTopic ());
78
77
webServer->sendContent (page);
78
+
79
+ webServer->client ().stop ();
79
80
}
80
81
81
82
void WebPortal::sendSensor (Entry* entry) {
@@ -174,7 +175,7 @@ void WebPortal::loop() {
174
175
}
175
176
176
177
String WebPortal::time (long time) {
177
- double utcOffset = config->getDouble (" time.offset" , 2 );
178
+ double utcOffset = 2 ; // config->getDouble("time.offset", 2);
178
179
179
180
long localTime = round (ntp->getTime (time) + 3600 * utcOffset);
180
181
@@ -191,11 +192,13 @@ String WebPortal::time(long time) {
191
192
}
192
193
193
194
bool WebPortal::auth () {
195
+ /*
194
196
char pass[32];
195
197
config->getCString("password", "", pass);
196
198
if (strlen(pass) > 0 && !webServer->authenticate("admin", pass)) {
197
199
webServer->requestAuthentication();
198
200
return false;
199
201
}
202
+ */
200
203
return true ;
201
204
}
0 commit comments