Remove Autostart parameter and make the flow to be always enabled (#3423)

* removed Autostart parameter and make it enabled by default

* .

* show menu entry in UI

* cleanup migration

* .

* .

* .

* .

* .

* .

* .

* .
This commit is contained in:
CaCO3
2024-12-05 01:04:24 +01:00
committed by GitHub
parent 1b5ff2ef1a
commit 708fd68cf5
10 changed files with 24 additions and 30 deletions

View File

@@ -196,7 +196,7 @@ bool ClassFlowControll::StartMQTTService()
void ClassFlowControll::SetInitialParameter(void)
{
AutoStart = false;
AutoStart = true;
SetupModeActive = false;
AutoInterval = 10; // Minutes
flowdigit = NULL;
@@ -210,7 +210,8 @@ void ClassFlowControll::SetInitialParameter(void)
bool ClassFlowControll::getIsAutoStart(void)
{
return AutoStart;
//return AutoStart;
return true; // Flow must always be enabled, else the manual trigger (REST, MQTT) will not work!
}
@@ -557,10 +558,6 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph)) {
splitted = ZerlegeZeile(aktparamgraph, " =");
if ((toUpper(splitted[0]) == "AUTOSTART") && (splitted.size() > 1)) {
AutoStart = alphanumericToBoolean(splitted[1]);
}
if ((toUpper(splitted[0]) == "INTERVAL") && (splitted.size() > 1)) {
if (isStringNumeric(splitted[1]))

View File

@@ -422,8 +422,7 @@ esp_err_t handler_flow_start(httpd_req_t *req)
else
{
LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Flow start triggered by REST API, but flow is not active!");
const char *resp_str = "WARNING: Flow start triggered by REST API, but flow is not active";
httpd_resp_send(req, resp_str, HTTPD_RESP_USE_STRLEN);
httpd_resp_send_err(req, HTTPD_403_FORBIDDEN, "Flow start triggered by REST API, but flow is not active");
}
#ifdef DEBUG_DETAIL_ON

View File

@@ -727,8 +727,7 @@ void migrateConfiguration(void) {
}
else if (section == "[AutoTimer]") {
migrated = migrated | replaceString(configLines[i], "Intervall", "Interval");
migrated = migrated | replaceString(configLines[i], ";AutoStart = true", ";AutoStart = false"); // Set it to its default value
migrated = migrated | replaceString(configLines[i], ";AutoStart", "AutoStart"); // Enable it
migrated = migrated | replaceString(configLines[i], "Autostart", ";UNUSED_PARAMETER"); // This parameter is no longer used
}
else if (section == "[Debug]") {
migrated = migrated | replaceString(configLines[i], "Logfile ", "LogLevel "); // Whitespace needed so it does not match `LogfileRetentionInDays`
@@ -741,7 +740,7 @@ void migrateConfiguration(void) {
else if (section == "[System]") {
migrated = migrated | replaceString(configLines[i], "RSSIThreashold", "RSSIThreshold");
migrated = migrated | replaceString(configLines[i], "AutoAdjustSummertime", ";UNUSED_PARAMETER"); // This parameter is no longer used
migrated = migrated | replaceString(configLines[i], ";SetupMode = true", ";SetupMode = false"); // Set it to its default value
migrated = migrated | replaceString(configLines[i], ";SetupMode", "SetupMode"); // Enable it
}