diff --git a/custom_components/aemet/AemetApi/__init__.py b/custom_components/aemet/AemetApi/__init__.py index 1dcdb4a..0e70b9d 100644 --- a/custom_components/aemet/AemetApi/__init__.py +++ b/custom_components/aemet/AemetApi/__init__.py @@ -1,10 +1,21 @@ import requests +import urllib3 from datetime import timedelta from logging import getLogger from homeassistant.util import Throttle _LOGGER = getLogger(__name__) +requests.packages.urllib3.disable_warnings() +requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ":HIGH:!DH:!aNULL" +try: + requests.packages.urllib3.contrib.pyopenssl.util.ssl_.DEFAULT_CIPHERS += ( + ":HIGH:!DH:!aNULL" + ) +except AttributeError: + # no pyopenssl support used / needed / available + pass + from homeassistant.components.weather import ( ATTR_WEATHER_HUMIDITY, ATTR_WEATHER_PRESSURE, @@ -102,4 +113,4 @@ def set_data(self, record): def get_data(self, variable): """Get the data.""" - return self.data.get(variable) \ No newline at end of file + return self.data.get(variable)