Skip to content

Commit f00bdcd

Browse files
author
brentru
committed
adding MQTT API integration
1 parent b1ae23c commit f00bdcd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Adafruit_IO/mqtt_client.py

+7
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ def subscribe_group(self, group_id):
197197
"""
198198
self._client.subscribe('{0}/groups/{1}'.format(self._username, group_id))
199199

200+
def subscribe_weather(self, weather_id, forecast_type):
201+
"""Subscribe to Adafruit IO Weather
202+
:param int weather_id: weather record you want data for
203+
:param string type: type of forecast data requested
204+
"""
205+
self._client.subscribe('{0}/integration/weather/{1}/{2}'.format(self._username, weather_id, forecast_type))
206+
200207
def subscribe_time(self, time):
201208
"""Subscribe to changes on the Adafruit IO time feeds. When the feed is
202209
updated, the on_message function will be called and publish a new value:

0 commit comments

Comments
 (0)