From cb2821b51219cfe8be0014bad0c0524dd8990b5b Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Wed, 27 May 2020 00:16:15 -0400 Subject: [PATCH] Fix empty preset element in ONVIF response (#36182) --- homeassistant/components/onvif/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/onvif/device.py b/homeassistant/components/onvif/device.py index 0e9d3ddca98..bbce71f5d28 100644 --- a/homeassistant/components/onvif/device.py +++ b/homeassistant/components/onvif/device.py @@ -297,7 +297,7 @@ class ONVIFDevice: try: ptz_service = self.device.create_ptz_service() presets = await ptz_service.GetPresets(profile.token) - profile.ptz.presets = [preset.token for preset in presets] + profile.ptz.presets = [preset.token for preset in presets if preset] except (Fault, ServerDisconnectedError): # It's OK if Presets aren't supported profile.ptz.presets = []