From 36f2fd5e900292dcd4da62cfd37cf91041a77ca4 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sat, 13 Apr 2024 19:17:40 +0200 Subject: [PATCH] =?UTF-8?q?Bump=20=C2=B4aiohttp=C2=B4=20from=203.9.3=20to?= =?UTF-8?q?=203.9.4=20(#403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ludy87 --- custom_components/xplora_watch/coordinator.py | 7 ++++--- custom_components/xplora_watch/geocoder.py | 3 ++- custom_components/xplora_watch/manifest.json | 11 ++++++----- hacs.json | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/custom_components/xplora_watch/coordinator.py b/custom_components/xplora_watch/coordinator.py index 64d8ee5..b9a43be 100644 --- a/custom_components/xplora_watch/coordinator.py +++ b/custom_components/xplora_watch/coordinator.py @@ -265,9 +265,10 @@ async def openstreetmap(self): """Get OpenStreetMap.org information for the location..""" try: language = self._entry.options.get(CONF_LANGUAGE, self._entry.data.get(CONF_LANGUAGE, DEFAULT_LANGUAGE)) - async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(DEFAULT_TIMEOUT)) as session, session.get( - URL_OPENSTREETMAP.format(self.lat, self.lng, language) - ) as response: + async with ( + aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(DEFAULT_TIMEOUT)) as session, + session.get(URL_OPENSTREETMAP.format(self.lat, self.lng, language)) as response, + ): res: dict[str, Any] = await response.json() self.licence = res.get(ATTR_TRACKER_LICENCE, None) address: dict[str, str] = res.get(ATTR_TRACKER_ADDR, {}) diff --git a/custom_components/xplora_watch/geocoder.py b/custom_components/xplora_watch/geocoder.py index 2dc0156..8ae2a3c 100644 --- a/custom_components/xplora_watch/geocoder.py +++ b/custom_components/xplora_watch/geocoder.py @@ -19,6 +19,7 @@ import backoff import requests +from security import safe_requests try: import aiohttp @@ -285,7 +286,7 @@ def _opencage_request(self, params): if self.session: response = self.session.get(self.url, params=params, headers=self._opencage_headers("aiohttp")) else: - response = requests.get( + response = safe_requests.get( self.url, params=params, headers=self._opencage_headers("requests"), timeout=DEFAULT_TIMEOUT ) diff --git a/custom_components/xplora_watch/manifest.json b/custom_components/xplora_watch/manifest.json index 57ee7f5..50c843d 100644 --- a/custom_components/xplora_watch/manifest.json +++ b/custom_components/xplora_watch/manifest.json @@ -9,14 +9,15 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/Ludy87/xplora_watch/issues", "requirements": [ - "pyxplora_api==2.12.6", + "pyxplora_api==2.12.7", "backoff==2.2.1", "requests==2.31.0", - "aiohttp==3.9.3", + "aiohttp==3.9.4", "geopy==2.4.1", - "dataclasses-json==0.6.3", + "dataclasses-json==0.6.4", "pydub", - "marshmallow-enum" + "marshmallow-enum", + "security==1.2.1" ], - "version": "v2.13.7" + "version": "v2.13.8" } diff --git a/hacs.json b/hacs.json index c2bf82e..712505a 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Xplora\u00ae Watch", "zip_release": true, "render_readme": true, - "homeassistant": "2024.2.0", + "homeassistant": "2024.4.3", "hacs": "1.34.0", "filename": "xplora_watch.zip" } \ No newline at end of file