Skip to content

Commit 72ecce1

Browse files
committed
Tuned packet queue & Update MQTT state after a reconnect
1 parent 7a3f0c9 commit 72ecce1

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/MQTT/BulbStateUpdater.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <Settings.h>
99

1010
#ifndef MILIGHT_MQTT_JSON_BUFFER_SIZE
11-
#define MILIGHT_MQTT_JSON_BUFFER_SIZE 1024
11+
#define MILIGHT_MQTT_JSON_BUFFER_SIZE 1536
1212
#endif
1313

1414
#ifndef BULB_STATE_UPDATER

lib/MiLight/PacketQueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <MiLightRemoteConfig.h>
88

99
#ifndef MILIGHT_MAX_QUEUED_PACKETS
10-
#define MILIGHT_MAX_QUEUED_PACKETS 20
10+
#define MILIGHT_MAX_QUEUED_PACKETS 30
1111
#endif
1212

1313
struct QueuedPacket {

src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ void applySettings() {
273273

274274
settings.deletedGroupIdAliases.clear();
275275
}
276+
277+
// make sure state is up to date
278+
for (auto itr = settings.groupIdAliases.begin(); itr != settings.groupIdAliases.end(); ++itr) {
279+
bulbStateUpdater->enqueueUpdate(itr->second);
280+
}
276281
});
277282

278283
bulbStateUpdater = new BulbStateUpdater(settings, *mqttClient, *stateStore);

0 commit comments

Comments
 (0)