Skip to content

Commit

Permalink
remove Debug Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarecrash committed Apr 6, 2024
1 parent 3c42d9c commit 370c3db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Settings
char httpUser[40]; // http basic auth username
char httpPass[40]; // http basic auth password
bool haDiscovery; // HomeAssistant Discovery switch
bool debugmode; // Debug-Mode
// bool debugmode; // Debug-Mode
} data;

void load()
Expand Down Expand Up @@ -114,10 +114,10 @@ class Settings
{
data.haDiscovery = false;
}
if (data.debugmode && !data.debugmode)
{
data.debugmode = false;
}
// if (data.debugmode && !data.debugmode)
//{
// data.debugmode = false;
//}
}
void coVersCheck()
{
Expand All @@ -137,7 +137,7 @@ class Settings
strcpy(data.httpUser, "");
strcpy(data.httpPass, "");
data.haDiscovery = false;
data.debugmode = false;
// data.debugmode = false;
save();
load();
}
Expand Down
4 changes: 2 additions & 2 deletions src/htmlProzessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ String htmlProcessor(const String &var)
return (_settings.data.httpPass);
if (var == F("pre_hadiscovery"))
return (_settings.data.haDiscovery ? "checked" : "");
if (var == F("pre_debugmode"))
return (_settings.data.debugmode ? "checked" : "");
//if (var == F("pre_debugmode"))
// return (_settings.data.debugmode ? "checked" : "");
return String();
}
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ void setup()
resetCounter(true);
_settings.load();
haAutoDiscTrigger = _settings.data.haDiscovery;
DebugMode = _settings.data.debugmode;
//DebugMode = _settings.data.debugmode;
DebugMode = true;
WiFi.persistent(true); // fix wifi save bug
// AsyncWiFiManager wm(&server, &dns); // create wifimanager instance

Expand Down Expand Up @@ -358,7 +359,7 @@ void setup()
strncpy(_settings.data.httpUser, request->arg("post_httpUser").c_str(), 40);
strncpy(_settings.data.httpPass, request->arg("post_httpPass").c_str(), 40);
_settings.data.haDiscovery = (request->arg("post_hadiscovery") == "true") ? true : false;
_settings.data.debugmode = (request->arg("post_debugmode") == "true") ? true : false;
//_settings.data.debugmode = (request->arg("post_debugmode") == "true") ? true : false;
_settings.save();
request->redirect("/reboot"); });

Expand Down
2 changes: 2 additions & 0 deletions src/webpages/HTML_SETTINGS_EDIT.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ <h1>Edit Configuration</h1>
id="post_webuicolormode" name="post_webuicolormode" value="true" %pre_webuidarkmode%>
</div>
</div>
<!--
<div class="input-group mb-2">
<span class="input-group-text w-50" id="debugmode">DEBUG (for testing purposes)</span>
<div class="form-switch form-control" style="width:50%%; text-align: center;">
<input type="checkbox" class="form-check-input form control" aria-describedby="debugmode" role="switch"
id="post_debugmode" name="post_debugmode" value="true" %pre_debugmode%>
</div>
</div>
-->
<div class="input-group mb-2">
<span class="input-group-text w-50" id="httpUserdesc">HTTP Username</span>
<input type="text" class="form-control" aria-describedby="httpUserdesc" id="httpUser" name="post_httpUser" maxlength="40"
Expand Down

0 comments on commit 370c3db

Please sign in to comment.