mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Release v1.5.2
* Additional filters for invalid frames * Added tilt calibration for integrated tilt blinds
This commit is contained in:
parent
e8296d3782
commit
156bdee0a5
6 changed files with 11 additions and 6 deletions
6
MQTT.cpp
6
MQTT.cpp
|
|
@ -100,6 +100,7 @@ bool MQTTClass::connect() {
|
|||
return true;
|
||||
}
|
||||
if(settings.MQTT.enabled) {
|
||||
if(this->lastConnect + 10000 > millis()) return false;
|
||||
uint64_t mac = ESP.getEfuseMac();
|
||||
snprintf(this->clientId, sizeof(this->clientId), "client-%08lx%08lx", (uint32_t)((mac >> 32) & 0xFFFFFFFF), (uint32_t)(mac & 0xFFFFFFFF));
|
||||
if(strlen(settings.MQTT.protocol) > 0 && strlen(settings.MQTT.hostname) > 0) {
|
||||
|
|
@ -112,11 +113,14 @@ bool MQTTClass::connect() {
|
|||
this->subscribe("shades/+/direction/set");
|
||||
this->subscribe("shades/+/mypos/set");
|
||||
mqttClient.setCallback(MQTTClass::receive);
|
||||
this->lastConnect = millis();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Serial.print("MQTT Connection failed for ");
|
||||
Serial.print("MQTT Connection failed for: ");
|
||||
Serial.println(mqttClient.state());
|
||||
this->lastConnect = millis();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue