From 3d5fd6c024279af2c677c88e1a7ed03cc2abd9a9 Mon Sep 17 00:00:00 2001 From: bittles Date: Mon, 16 Jan 2023 13:17:54 -0500 Subject: [PATCH 1/3] Fix const calls --- custom_components/ecovacs/sucks_mqtt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/ecovacs/sucks_mqtt.py b/custom_components/ecovacs/sucks_mqtt.py index 4289ab9..beea171 100644 --- a/custom_components/ecovacs/sucks_mqtt.py +++ b/custom_components/ecovacs/sucks_mqtt.py @@ -134,7 +134,7 @@ def _wrap_command(self, cmd, recipient): payloadxml.attrib.pop("td") return { 'auth': { - 'realm': API_REALM, + 'realm': ecovacs_api_const.API_REALM, 'resource': self.resource, 'token': self.secret, 'userid': self.user, @@ -154,7 +154,7 @@ def __call_iotdevmanager_api(self, args, verify_ssl=True): LOGGER.debug("calling iotdevmanager api with {}".format(args)) params = {} 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 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 From 646ff4ecbbf0edb3a5daf026ebcbb4c6a6ea6ec3 Mon Sep 17 00:00:00 2001 From: bittles Date: Mon, 16 Jan 2023 13:19:42 -0500 Subject: [PATCH 2/3] Add API_PORTAL_URL_FORMAT import --- custom_components/ecovacs/sucks_mqtt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/ecovacs/sucks_mqtt.py b/custom_components/ecovacs/sucks_mqtt.py index beea171..eaf0ca9 100644 --- a/custom_components/ecovacs/sucks_mqtt.py +++ b/custom_components/ecovacs/sucks_mqtt.py @@ -10,7 +10,7 @@ from paho.mqtt import subscribe as MQTTSubscribe from sleekxmppfs.xmlstream import ET -from .sucks_api_const import API_REALM, API_IOTDEVMANAGERAPI +from .sucks_api_const import API_REALM, API_IOTDEVMANAGERAPI, API_PORTAL_URL_FORMAT import logging LOGGER = logging.getLogger(__name__) @@ -134,7 +134,7 @@ def _wrap_command(self, cmd, recipient): payloadxml.attrib.pop("td") return { 'auth': { - 'realm': ecovacs_api_const.API_REALM, + 'realm': API_REALM, 'resource': self.resource, 'token': self.secret, 'userid': self.user, @@ -154,7 +154,7 @@ def __call_iotdevmanager_api(self, args, verify_ssl=True): LOGGER.debug("calling iotdevmanager api with {}".format(args)) params = {} params.update(args) - url = (ecovacs_api_const.API_PORTAL_URL_FORMAT + "/" + ecovacs_api_const.API_IOTDEVMANAGERAPI).format(continent=self.continent) + url = (API_PORTAL_URL_FORMAT + "/" + API_IOTDEVMANAGERAPI).format(continent=self.continent) response = None 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 From 45244f3744c6e91372a478d2005035882aa74643 Mon Sep 17 00:00:00 2001 From: bittles Date: Mon, 16 Jan 2023 13:21:19 -0500 Subject: [PATCH 3/3] Bump version to 1.5.1 --- custom_components/ecovacs/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecovacs/manifest.json b/custom_components/ecovacs/manifest.json index c7ec192..b66e721 100644 --- a/custom_components/ecovacs/manifest.json +++ b/custom_components/ecovacs/manifest.json @@ -1,7 +1,7 @@ { "domain": "ecovacs", "name": "Ecovacs Bumper", - "version": "1.5.0", + "version": "1.5.1", "documentation": "https://github.com/bittles/ha_ecovacs_bumper", "issue_tracker": "https://github.com/bittles/ha_ecovacs_bumper/issues", "requirements": ["sleekxmppfs==1.4.1", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"],