Skip to content

Commit 2e6c781

Browse files
authored
Merge pull request #22 from Neradoc/fix-documentation-params-and-code-blocks
Fix documentation of params and code blocks
2 parents 8a6649d + 3c99fca commit 2e6c781

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

adafruit_gc_iot_core.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ def loop(self):
188188
need to manually call this method within a loop to retain connection.
189189
190190
Example of "pumping" a Google Core IoT loop.
191-
..code-block:: python
191+
192+
.. code-block:: python
192193
193194
while True:
194195
google_iot.loop()
@@ -199,6 +200,7 @@ def loop(self):
199200

200201
def unsubscribe(self, topic, subfolder=None):
201202
"""Unsubscribes from a Google Cloud IoT device topic.
203+
202204
:param str topic: Required MQTT topic. Defaults to events.
203205
:param str subfolder: Optional MQTT topic subfolder. Defaults to None.
204206
@@ -211,13 +213,15 @@ def unsubscribe(self, topic, subfolder=None):
211213

212214
def unsubscribe_from_all_commands(self):
213215
"""Unsubscribes from a device's "commands/#" topic.
216+
214217
:param int qos: Quality of Service level for the message.
215218
216219
"""
217220
self.unsubscribe("commands/#")
218221

219222
def subscribe(self, topic, subfolder=None, qos=1):
220223
"""Subscribes to a Google Cloud IoT device topic.
224+
221225
:param str topic: Required MQTT topic. Defaults to events.
222226
:param str subfolder: Optional MQTT topic subfolder. Defaults to None.
223227
:param int qos: Quality of Service level for the message.
@@ -231,6 +235,7 @@ def subscribe(self, topic, subfolder=None, qos=1):
231235

232236
def subscribe_to_subfolder(self, topic, subfolder, qos=1):
233237
"""Subscribes to a Google Cloud IoT device's topic subfolder
238+
234239
:param str topic: Required MQTT topic.
235240
:param str subfolder: Optional MQTT topic subfolder. Defaults to None.
236241
:param int qos: Quality of Service level for the message.
@@ -241,6 +246,7 @@ def subscribe_to_subfolder(self, topic, subfolder, qos=1):
241246
def subscribe_to_config(self, qos=1):
242247
"""Subscribes to a Google Cloud IoT device's configuration
243248
topic.
249+
244250
:param int qos: Quality of Service level for the message.
245251
246252
"""
@@ -331,11 +337,13 @@ def client_id(self):
331337

332338
def generate_jwt(self, ttl=43200, algo="RS256"):
333339
"""Generates a JSON Web Token (https://jwt.io/) using network time.
340+
334341
:param int jwt_ttl: When the JWT token expires, defaults to 43200 minutes (or 12 hours).
335342
:param str algo: Algorithm used to create a JSON Web Token.
336343
337344
Example usage of generating and setting a JSON-Web-Token:
338-
..code-block:: python
345+
346+
.. code-block:: python
339347
340348
jwt = CloudCore.generate_jwt()
341349
print("Generated JWT: ", jwt)

0 commit comments

Comments
 (0)