VCR YR sensor test
This commit is contained in:
parent
ca6b957839
commit
c1eaf60461
5 changed files with 49 additions and 42 deletions
|
@ -206,7 +206,8 @@ class YrData(object):
|
|||
if self._nextrun is not None and dt_util.utcnow() <= self._nextrun:
|
||||
return
|
||||
try:
|
||||
response = requests.get(self._url)
|
||||
with requests.Session() as sess:
|
||||
response = sess.get(self._url)
|
||||
except requests.RequestException:
|
||||
return
|
||||
if response.status_code != 200:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue