diff --git a/lib/MQTT/BulbStateUpdater.cpp b/lib/MQTT/BulbStateUpdater.cpp index ba20eebf..d5cca4cf 100644 --- a/lib/MQTT/BulbStateUpdater.cpp +++ b/lib/MQTT/BulbStateUpdater.cpp @@ -41,7 +41,7 @@ inline void BulbStateUpdater::flushGroup(BulbId bulbId, GroupState& state) { JsonObject message = json.to(); state.applyState(message, bulbId, settings.groupStateFields); - if (json.overflowed()) { + if (json.memoryUsage() >= json.capacity()) { Serial.println(F("ERROR: State is too large for MQTT buffer, continuing anyway. Consider increasing MILIGHT_MQTT_JSON_BUFFER_SIZE.")); }