mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
minor changes to reporting
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -176,7 +176,7 @@ class Mqtt {
|
||||
static uint16_t mqtt_message_id_;
|
||||
|
||||
static constexpr size_t MAX_MQTT_MESSAGES = 70; // size of queue
|
||||
static constexpr uint32_t MQTT_PUBLISH_WAIT = 100; // delay between sending publishes, to account for large payloads
|
||||
static constexpr uint32_t MQTT_PUBLISH_WAIT = 200; // delay between sending publishes, to account for large payloads
|
||||
static constexpr uint8_t MQTT_PUBLISH_MAX_RETRY = 3; // max retries for giving up on publishing
|
||||
|
||||
static std::shared_ptr<const MqttMessage> queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, bool retain);
|
||||
|
||||
Reference in New Issue
Block a user