Skip to content

Fixes per sommersoft's review #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* Adafruit's ESP32SPI library:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
"""
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
from adafruit_io.adafruit_io_errors import AdafruitIO_RequestError, AdafruitIO_ThrottleError

__version__ = "0.0.0-auto.0"
Expand All @@ -56,7 +57,7 @@ def __init__(self, adafruit_io_username, adafruit_io_key, wifi_manager):
"""
self.username = adafruit_io_username
self.key = adafruit_io_key
if wifi_manager:
if isinstance(wifi_manager, adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager):
self.wifi = wifi_manager
else:
raise TypeError("This library requires a WiFiManager object.")
Expand Down Expand Up @@ -89,7 +90,7 @@ def _compose_path(self, path):
"""Composes a valid API request path.
:param str path: Adafruit IO API URL path.
"""
return "{0}/{1}/{2}/{3}".format('https://io.adafruit.com/api', 'v2', self.username, path)
return "https://io.adafruit.com/api/v2/{0}/{1}".format(self.username, path)

# HTTP Requests
def _post(self, path, payload):
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ API
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
.. use this format as the module name: "adafruit_foo.foo"

.. automodule:: adafruit_io
.. automodule:: adafruit_io.adafruit_io
:members:
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
'sphinx.ext.todo',
]

autodoc_mock_imports = ["digitalio", "busdevice", "neopixel", "adafruit_esp32spi"]

intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

# Add any paths that contain templates here, relative to this directory.
Expand Down