Add receive method for MQTT

While mqtt is pub/sub and not request/response, there’s a trick we’ve added into the Adafruit IO MQTT Client which allows you to get the most recent value of a feed.

If you are subbed to username/feeds/key and publish to username/feeds/key/get then IO will send the most recent value to the client on the original subscription. The important fact is that username/feeds/key should be the same for both (you can’t have one use feed.key and one use

We’ve exposed this functionality in Adafruit IO Arduino, but should add it into Adafruit IO Python too

Read more here: Source link