minor changes to reporting

This commit is contained in:
proddy
2020-10-20 21:07:34 +02:00
parent 73008bfe5f
commit 31a2367740
2 changed files with 3 additions and 3 deletions

View File

@@ -735,7 +735,7 @@ void Mqtt::register_mqtt_ha_binary_sensor(const __FlashStringHelper * name, cons
#if defined(EMSESP_STANDALONE)
LOG_DEBUG(F("Publishing topic %s"), topic);
#else
if (packet_id == 0) {
if (!packet_id) {
LOG_ERROR(F("Failed to publish topic %s"), topic);
} else {
LOG_DEBUG(F("Publishing topic %s"), topic);
@@ -822,7 +822,7 @@ void Mqtt::register_mqtt_ha_sensor(const char * prefix,
std::string payload_text;
serializeJson(doc, payload_text); // convert json to string
uint16_t packet_id = mqttClient_->publish(topic, 0, true, payload_text.c_str(), payload_text.size());
if (packet_id == 0) {
if (!packet_id) {
LOG_ERROR(F("Failed to publish topic %s"), topic);
} else {
#if defined(EMSESP_STANDALONE)