From f828cdcaef302afd9b52a14fe450dd58d1cf29dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 6 Sep 2020 23:52:06 +0300 Subject: [PATCH] Fix setup of ONVIF devices without snapshot capability (#39723) * Fix setup of ONVIF devices without snapshot capability * Unrelated debug message typo fix --- homeassistant/components/onvif/__init__.py | 2 ++ homeassistant/components/onvif/device.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/onvif/__init__.py b/homeassistant/components/onvif/__init__.py index 93e948b770b..964c7a70a6d 100644 --- a/homeassistant/components/onvif/__init__.py +++ b/homeassistant/components/onvif/__init__.py @@ -127,6 +127,8 @@ async def _get_snapshot_auth(hass, device, entry): return HTTP_DIGEST_AUTHENTICATION snapshot_uri = await device.async_get_snapshot_uri(device.profiles[0]) + if not snapshot_uri: + return HTTP_DIGEST_AUTHENTICATION auth = HTTPDigestAuth(device.username, device.password) def _get(): diff --git a/homeassistant/components/onvif/device.py b/homeassistant/components/onvif/device.py index 1a879e54767..1dfa670114f 100644 --- a/homeassistant/components/onvif/device.py +++ b/homeassistant/components/onvif/device.py @@ -217,7 +217,7 @@ class ONVIFDevice: raise fault LOGGER.debug( - "Couldn't get network interfaces from ONVIF deivice '%s'. Error: %s", + "Couldn't get network interfaces from ONVIF device '%s'. Error: %s", self.name, fault, )