From 2ac1fe7812ce6ac4be733db4f43f86aab486de95 Mon Sep 17 00:00:00 2001 From: Adam Bachman Date: Fri, 20 Apr 2018 12:00:52 -0400 Subject: [PATCH] separate _get_pub init from _get_sub init --- src/AdafruitIO_Feed.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AdafruitIO_Feed.cpp b/src/AdafruitIO_Feed.cpp index 66c5835..021c465 100644 --- a/src/AdafruitIO_Feed.cpp +++ b/src/AdafruitIO_Feed.cpp @@ -118,7 +118,10 @@ bool AdafruitIO_Feed::get() strcat(_get_topic, "/f/"); strcat(_get_topic, name); strcat(_get_topic, "/csv/get"); + } + if (!_get_pub) + { _get_pub = new Adafruit_MQTT_Publish(_io->_mqtt, _get_topic); }