split HA-config in smaller blocks, add publish command

This commit is contained in:
MichaelDvP
2020-11-13 13:29:19 +01:00
parent f5b7bad2fb
commit 1578168167
19 changed files with 202 additions and 114 deletions

View File

@@ -40,7 +40,9 @@ using uuid::console::Shell;
#define EMSESP_MAX_JSON_SIZE_SMALL 256 // for smaller json docs when using StaticJsonDocument
#define EMSESP_MAX_JSON_SIZE_MEDIUM 768 // for smaller json docs from ems devices, when using StaticJsonDocument
#define EMSESP_MAX_JSON_SIZE_LARGE 2048 // for large json docs from ems devices, like boiler or thermostat data. Using DynamicJsonDocument
// #define EMSESP_MAX_JSON_SIZE_LARGE 2048 // for large json docs from ems devices, like boiler or thermostat data. Using DynamicJsonDocument
// mqtt does not publish larger than 1570 on esp8266, boiler message is split and now smaller
#define EMSESP_MAX_JSON_SIZE_LARGE 1536 // for large json docs from ems devices, like boiler or thermostat data. Using StaticJsonDocument
namespace emsesp {
@@ -170,10 +172,10 @@ class Mqtt {
static AsyncMqttClient * mqttClient_;
static size_t maximum_mqtt_messages_;
// static size_t maximum_mqtt_messages_;
static uint16_t mqtt_message_id_;
static constexpr size_t MAX_MQTT_MESSAGES = 70; // size of queue
static constexpr size_t MAX_MQTT_MESSAGES = 20; // size of queue
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