mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
publish MQTT shower info when connected
This commit is contained in:
@@ -403,7 +403,7 @@ bool MyESP::mqttPublish(const char * topic, const char * payload) {
|
|||||||
_addMQTTLog(topic, payload, 1); // add to the log, using type of 1 for Publish
|
_addMQTTLog(topic, payload, 1); // add to the log, using type of 1 for Publish
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
myDebug_P(PSTR("[MQTT] Error publishing to %s with payload %s, error %d"), _mqttTopic(topic), payload, packet_id);
|
myDebug_P(PSTR("[MQTT] Error publishing to %s with payload %s [error %d]"), _mqttTopic(topic), payload, packet_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1529,6 +1529,9 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
// for receiving shower_Timer and shower_alert switches
|
// for receiving shower_Timer and shower_alert switches
|
||||||
myESP.mqttSubscribe(TOPIC_SHOWER_DATA);
|
myESP.mqttSubscribe(TOPIC_SHOWER_DATA);
|
||||||
|
|
||||||
|
// send Shower Alert and Timer switch settings
|
||||||
|
do_publishShowerData();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2056,7 +2059,6 @@ void loop() {
|
|||||||
if (ems_getEmsRefreshed() && (scanThermostat_count == 0)) {
|
if (ems_getEmsRefreshed() && (scanThermostat_count == 0)) {
|
||||||
publishValues(false);
|
publishValues(false);
|
||||||
do_publishSensorValues();
|
do_publishSensorValues();
|
||||||
do_publishShowerData();
|
|
||||||
ems_setEmsRefreshed(false); // reset
|
ems_setEmsRefreshed(false); // reset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user