Fix bug with aioHTTP and none authentification (#4116)

pull/4126/head
Pascal Vizeli 2016-10-29 22:47:46 +02:00 committed by GitHub
parent 54d19e3c53
commit edeb31d74e
1 changed files with 5 additions and 4 deletions

View File

@ -72,10 +72,11 @@ class MjpegCamera(Camera):
self._mjpeg_url = device_info[CONF_MJPEG_URL]
self._auth = None
if self._authentication == HTTP_BASIC_AUTHENTICATION:
self._auth = aiohttp.BasicAuth(
self._username, password=self._password
)
if self._username and self._password:
if self._authentication == HTTP_BASIC_AUTHENTICATION:
self._auth = aiohttp.BasicAuth(
self._username, password=self._password
)
def camera_image(self):
"""Return a still image response from the camera."""