From 4df3667c381982d0dd7613ea561dbad0a1ca2225 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Tue, 18 Dec 2018 08:02:02 -0500 Subject: [PATCH] v1.1.11 - More Auto-Discovery fix for HA version >= 0.84 #286 - Suggestions from https://github.com/home-assistant/home-assistant/issues/19420 --- Arduino/McLighting/request_handlers.h | 6 ++---- Arduino/McLighting/version.h | 2 +- Arduino/McLighting/version_info.ino | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index 743e04a0..1d8cf125 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -936,11 +936,10 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght ha_send_data.detach(); mqtt_client.subscribe(mqtt_ha_state_in.c_str(), qossub); #ifdef MQTT_HOME_ASSISTANT_SUPPORT - DynamicJsonDocument jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(12)); + DynamicJsonDocument jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(12) + 1500); JsonObject json = jsonBuffer.to(); json["name"] = HOSTNAME; #ifdef MQTT_HOME_ASSISTANT_0_84_SUPPORT - json["platform"] = "mqtt"; json["schema"] = "json"; #else json["platform"] = "mqtt_json"; @@ -1021,11 +1020,10 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght uint16_t packetIdSub2 = amqttClient.subscribe((char *)mqtt_ha_state_in.c_str(), qossub); DBG_OUTPUT_PORT.printf("Subscribing at QoS %d, packetId: ", qossub); DBG_OUTPUT_PORT.println(packetIdSub2); #ifdef MQTT_HOME_ASSISTANT_SUPPORT - DynamicJsonDocument jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(12)); + DynamicJsonDocument jsonBuffer(JSON_ARRAY_SIZE(strip.getModeCount()) + JSON_OBJECT_SIZE(12) + 1500); JsonObject json = jsonBuffer.to(); json["name"] = HOSTNAME; #ifdef MQTT_HOME_ASSISTANT_0_84_SUPPORT - json["platform"] = "mqtt"; json["schema"] = "json"; #else json["platform"] = "mqtt_json"; diff --git a/Arduino/McLighting/version.h b/Arduino/McLighting/version.h index 3d0423e4..4da84ba0 100644 --- a/Arduino/McLighting/version.h +++ b/Arduino/McLighting/version.h @@ -1 +1 @@ -#define SKETCH_VERSION "2.1.10" \ No newline at end of file +#define SKETCH_VERSION "2.1.11" \ No newline at end of file diff --git a/Arduino/McLighting/version_info.ino b/Arduino/McLighting/version_info.ino index f93acc6b..f039c4c9 100644 --- a/Arduino/McLighting/version_info.ino +++ b/Arduino/McLighting/version_info.ino @@ -44,4 +44,8 @@ * * 16 Dec 2018 v 1.1.10 * - more ArduinoJson library memory managment fixes + * + * 18 Dec 2018 v 2.1.11 + * - More Auto-Discovery fix for HA version >= 0.84 #286 + * - Suggestions from https://github.com/home-assistant/home-assistant/issues/19420 */