converted serial prints into MQTT status log messages

This commit is contained in:
Ollo
2021-07-01 22:06:50 +02:00
parent f1d55ed603
commit 57d18af76d
4 changed files with 45 additions and 38 deletions

View File

@@ -87,6 +87,13 @@ void Plant::deactivatePump(void)
}
}
void Plant::publishState(String state) {
if (this->mConnected)
{
this->mPlant->setProperty("state").send(state);
}
}
void Plant::activatePump(void)
{
int plantId = this->mPlantId;
@@ -108,6 +115,7 @@ void Plant::advertise(void)
//FIXME add .settable(this->switchHandler)
this->mPlant->advertise("moist").setName("Percent").setDatatype("number").setUnit("%");
this->mPlant->advertise("moistraw").setName("adc").setDatatype("number").setUnit("3.3/4096V");
this->mPlant->advertise("state").setName("state").setDatatype("string");
}
/* FIXME