From edeb31d74e27e6f8d8c7d58830b7902b6b45db2d Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 29 Oct 2016 22:47:46 +0200 Subject: [PATCH] Fix bug with aioHTTP and none authentification (#4116) --- homeassistant/components/camera/mjpeg.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/camera/mjpeg.py b/homeassistant/components/camera/mjpeg.py index e92274247de..42baab0bbf3 100644 --- a/homeassistant/components/camera/mjpeg.py +++ b/homeassistant/components/camera/mjpeg.py @@ -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."""