@@ -42,29 +42,28 @@ class Client(object):
42
42
REST API. Use this client class to send, receive, and enumerate feed data.
43
43
"""
44
44
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' ):
46
46
"""Create an instance of the Adafruit IO REST API client. Key must be
47
47
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).
52
51
"""
53
52
self .username = username
54
53
self .key = key
55
54
self .proxies = proxies
56
- self .api_version = api_version
57
55
# self.logger = logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
58
56
59
57
# Save URL without trailing slash as it will be added later when
60
58
# constructing the path.
61
59
self .base_url = base_url .rstrip ('/' )
62
60
61
+
63
62
def _compose_url (self , path , is_time = None ):
64
63
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 )
66
65
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 )
68
67
69
68
70
69
def _handle_error (self , response ):
0 commit comments