Skip to content

Commit

Permalink
Merge pull request #20 from fermartv/master
Browse files Browse the repository at this point in the history
Fixes api key too short error
  • Loading branch information
kalanda authored Dec 19, 2020
2 parents 33914fd + ac44dd6 commit 16629e5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion custom_components/aemet/AemetApi/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -102,4 +113,4 @@ def set_data(self, record):

def get_data(self, variable):
"""Get the data."""
return self.data.get(variable)
return self.data.get(variable)

0 comments on commit 16629e5

Please sign in to comment.