From 2d1ec8edc62b816bb4083a618e9476314299d100 Mon Sep 17 00:00:00 2001 From: Michael Dobson Date: Sat, 24 Mar 2018 18:56:27 -0700 Subject: [PATCH 1/3] Modified arlo object to make smarter HTTP requests for an async environment (conn pool, blocking) --- homeassistant/components/arlo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/arlo.py b/homeassistant/components/arlo.py index 7e51ec8c045e1..87d48c253af2c 100644 --- a/homeassistant/components/arlo.py +++ b/homeassistant/components/arlo.py @@ -8,6 +8,7 @@ import voluptuous as vol from requests.exceptions import HTTPError, ConnectTimeout +from requests.adapters import HTTPAdapter from homeassistant.helpers import config_validation as cv from homeassistant.const import CONF_USERNAME, CONF_PASSWORD @@ -43,6 +44,7 @@ def setup(hass, config): from pyarlo import PyArlo arlo = PyArlo(username, password, preload=False) + arlo.session.mount('https://',HTTPAdapter(pool_maxsize=10,pool_block=True)) if not arlo.is_connected: return False hass.data[DATA_ARLO] = arlo From 9988acdadc68d75ad9638f86276c6bba72bd8b27 Mon Sep 17 00:00:00 2001 From: Michael Dobson Date: Sat, 24 Mar 2018 20:44:27 -0700 Subject: [PATCH 2/3] fixes to formatting --- homeassistant/components/arlo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/arlo.py b/homeassistant/components/arlo.py index 87d48c253af2c..acce652595c59 100644 --- a/homeassistant/components/arlo.py +++ b/homeassistant/components/arlo.py @@ -44,7 +44,8 @@ def setup(hass, config): from pyarlo import PyArlo arlo = PyArlo(username, password, preload=False) - arlo.session.mount('https://',HTTPAdapter(pool_maxsize=10,pool_block=True)) + arlo.session.mount('https://', + HTTPAdapter(pool_maxsize=10, pool_block=True)) if not arlo.is_connected: return False hass.data[DATA_ARLO] = arlo From 48bc69e17eecba7283692839a312cbff0d0360f2 Mon Sep 17 00:00:00 2001 From: Michael Dobson Date: Sat, 24 Mar 2018 20:57:16 -0700 Subject: [PATCH 3/3] fixed formatting compliance --- homeassistant/components/arlo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/arlo.py b/homeassistant/components/arlo.py index acce652595c59..c856f058fac51 100644 --- a/homeassistant/components/arlo.py +++ b/homeassistant/components/arlo.py @@ -44,8 +44,8 @@ def setup(hass, config): from pyarlo import PyArlo arlo = PyArlo(username, password, preload=False) - arlo.session.mount('https://', - HTTPAdapter(pool_maxsize=10, pool_block=True)) + arlo.session.mount( + 'https://', HTTPAdapter(pool_maxsize=10, pool_block=True)) if not arlo.is_connected: return False hass.data[DATA_ARLO] = arlo