Skip to content

Commit 808ec3f

Browse files
authored
Merge pull request #90 from brentru/remove-api-version-kwarg
Remove api_version kwarg from init
2 parents 608105d + afa3de3 commit 808ec3f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Adafruit_IO/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1.2"
1+
__version__ = "2.1.3"

Adafruit_IO/client.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,28 @@ class Client(object):
4242
REST API. Use this client class to send, receive, and enumerate feed data.
4343
"""
4444

45-
def __init__(self, username, key, proxies=None, base_url='https://io.adafruit.com', api_version = 'v2'):
45+
def __init__(self, username, key, proxies=None, base_url='https://io.adafruit.com'):
4646
"""Create an instance of the Adafruit IO REST API client. Key must be
4747
provided and set to your Adafruit IO access key value. Optionaly
48-
provide a proxies dict in the format used by the requests library, a
49-
base_url to point at a different Adafruit IO service (the default is
50-
the production Adafruit IO service over SSL), and a api_version to
51-
add support for future API versions.
48+
provide a proxies dict in the format used by the requests library,
49+
and a base_url to point at a different Adafruit IO service
50+
(the default is the production Adafruit IO service over SSL).
5251
"""
5352
self.username = username
5453
self.key = key
5554
self.proxies = proxies
56-
self.api_version = api_version
5755
# self.logger = logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
5856

5957
# Save URL without trailing slash as it will be added later when
6058
# constructing the path.
6159
self.base_url = base_url.rstrip('/')
6260

61+
6362
def _compose_url(self, path, is_time=None):
6463
if is_time: # return a call to https://io.adafruit.com/api/v2/time/{unit}
65-
return '{0}/api/{1}/{2}'.format(self.base_url, self.api_version, path)
64+
return '{0}/api/{1}/{2}'.format(self.base_url, 'v2', path)
6665
else:
67-
return '{0}/api/{1}/{2}/{3}'.format(self.base_url, self.api_version, self.username, path)
66+
return '{0}/api/{1}/{2}/{3}'.format(self.base_url, 'v2', self.username, path)
6867

6968

7069
def _handle_error(self, response):

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TestClient(base.IOTestCase):
2828
# Helper Methods
2929
def get_client(self):
3030
# Construct an Adafruit IO REST client and return it.
31-
return Client(self.get_test_username(), self.get_test_key(), proxies=PROXIES, base_url=BASE_URL, api_version = "v2")
31+
return Client(self.get_test_username(), self.get_test_key(), proxies=PROXIES, base_url=BASE_URL)
3232

3333
def ensure_feed_deleted(self, client, feed):
3434
# Delete the specified feed if it exists.

0 commit comments

Comments
 (0)