From 4b498d7afd6c761735aaad4c5125e2d476ecb390 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Wed, 22 May 2024 00:04:21 +0200 Subject: [PATCH] reorganize platformio.ini configuration --- gateway/include/mqtt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gateway/include/mqtt.h b/gateway/include/mqtt.h index 23ee529..840372e 100644 --- a/gateway/include/mqtt.h +++ b/gateway/include/mqtt.h @@ -31,14 +31,18 @@ namespace Mqtt { } void publishInit() { +#if MQTT_CLEANUP Ha::publisher = publish; Component::components.forEach([](Component* c) { c->publishConfig(); }); AbstractBuilder::deleteAll(); +#endif ts.deleteTask(tPublishInit); } void publishCleanupConfig() { +#if MQTT_CLEANUP Component::components.forEach([](Component* c) { c->publishCleanupConfig(); }); +#endif } void onMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {