[SYS] Refine json buffer maximum size (#2005)
Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
1 parent
04c3e7ef95
commit
1c942a06cc
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -158,7 +158,7 @@
|
||||
# if MQTT_SECURE_DEFAULT
|
||||
# define JSON_MSG_BUFFER_MAX 2048 // Json message buffer size increased to handle certificate changes through MQTT, used for the queue and the coming MQTT messages
|
||||
# else
|
||||
# define JSON_MSG_BUFFER_MAX JSON_MSG_BUFFER
|
||||
# define JSON_MSG_BUFFER_MAX 898 // Minimum size for the cover MQTT discovery message
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ void createDiscovery(const char* sensor_type,
|
||||
const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* cmd_topic,
|
||||
const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_id, bool retainCmd,
|
||||
const char* state_class, const char* state_off, const char* state_on, const char* enum_options, const char* command_template) {
|
||||
StaticJsonDocument<1024> jsonBuffer;
|
||||
StaticJsonDocument<JSON_MSG_BUFFER_MAX> jsonBuffer;
|
||||
JsonObject sensor = jsonBuffer.to<JsonObject>();
|
||||
|
||||
// If a component cannot render it's state (f.i. KAKU relays) no state topic
|
||||
|
||||
Reference in new issue
Block a user