Wifi managers improvements (#503)

* Add parameters to wifi manager: gateway name and base topic
Enable to restart the ESP and erase the parameters by MQTT
This commit is contained in:
Florian authored and GitHub committed 2019-12-07 10:18:42 +01:00
1 parent a05fd01505
commit 4b1f09b06b
41 files changed
+308 -196

No files matched your search

+9 -3
View File
@@ -530,7 +530,12 @@ void MiBandDiscovery(char * mac){
while(true){
trc(taskMessage);
delay(BLEinterval);
BLEscan();
if (client.state() == 0) {
BLEscan();
}else{
trc("MQTT client disconnected no BLE scan");
delay(1000);
}
}
}
@@ -993,12 +998,13 @@ void haRoomPresence(JsonObject& HomePresence){
HomePresence["distance"] = distance;
trc(F("BLE DISTANCE :"));
trc(distance);
pub(subjectHomePresence,HomePresence);
String topic = String(Base_Topic) + "home_presence/" + String(gateway_name);
pub_custom_topic((char *)topic.c_str(),HomePresence);
}
#endif
void MQTTtoBT(char * topicOri, JsonObject& BTdata) { // json object decoding
if (strcmp(topicOri,subjectMQTTtoBTset) == 0){
if (strstr(topicOri,catToMainTopic(subjectMQTTtoBTset)) != NULL){
trc(F("MQTTtoBT json set"));
// Black list & white list set