mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 11:36:51 +03:00
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:
@@ -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]))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user