Fix const calls
This commit is contained in:
@@ -134,7 +134,7 @@ class EcoVacsIOTMQ(ClientMQTT):
|
|||||||
payloadxml.attrib.pop("td")
|
payloadxml.attrib.pop("td")
|
||||||
return {
|
return {
|
||||||
'auth': {
|
'auth': {
|
||||||
'realm': API_REALM,
|
'realm': ecovacs_api_const.API_REALM,
|
||||||
'resource': self.resource,
|
'resource': self.resource,
|
||||||
'token': self.secret,
|
'token': self.secret,
|
||||||
'userid': self.user,
|
'userid': self.user,
|
||||||
@@ -154,7 +154,7 @@ class EcoVacsIOTMQ(ClientMQTT):
|
|||||||
LOGGER.debug("calling iotdevmanager api with {}".format(args))
|
LOGGER.debug("calling iotdevmanager api with {}".format(args))
|
||||||
params = {}
|
params = {}
|
||||||
params.update(args)
|
params.update(args)
|
||||||
url = (API_PORTAL_URL_FORMAT + "/" + API_IOTDEVMANAGERAPI).format(continent=self.continent)
|
url = (ecovacs_api_const.API_PORTAL_URL_FORMAT + "/" + ecovacs_api_const.API_IOTDEVMANAGERAPI).format(continent=self.continent)
|
||||||
response = None
|
response = None
|
||||||
try: #The RestAPI sometimes doesnt provide a response depending on command, reduce timeout to 3 to accomodate and make requests faster
|
try: #The RestAPI sometimes doesnt provide a response depending on command, reduce timeout to 3 to accomodate and make requests faster
|
||||||
response = requests.post(url, json=params, timeout=3, verify=verify_ssl) #May think about having timeout as an arg that could be provided in the future
|
response = requests.post(url, json=params, timeout=3, verify=verify_ssl) #May think about having timeout as an arg that could be provided in the future
|
||||||
|
|||||||
Reference in New Issue
Block a user