Enhance homeassistant discovery (V5) (#1275)

* manual re-creation of #1246

* removed non-working approach to get interval

* postpone the MQTT service start until the ClassFlowControll::ReadParameter() gets called

* Increase the max_uri_handlers to 35 (was 30)

* removed newlines in logs

* added parameter to UI

* Register handler to re-start MQTT Discovery

* fix param
This commit is contained in:
CaCO3
2022-11-05 19:32:58 +01:00
committed by GitHub
parent 22fe50f80a
commit 3e082ed06e
10 changed files with 429 additions and 193 deletions

View File

@@ -29,7 +29,6 @@ extern "C" {
static const char* TAG = "flow_controll";
float AutoIntervalShared = 10;
std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
@@ -142,7 +141,7 @@ void ClassFlowControll::SetInitialParameter(void)
{
AutoStart = false;
SetupModeActive = false;
AutoIntervall = 10;
AutoIntervall = 10; // Minutes
flowdigit = NULL;
flowanalog = NULL;
flowpostprocessing = NULL;
@@ -517,7 +516,11 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
}
}
AutoIntervalShared = AutoIntervall;
/* Start the MQTT service */
for (int i = 0; i < FlowControll.size(); ++i)
if (FlowControll[i]->name().compare("ClassFlowMQTT") == 0)
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoIntervall);
return true;
}