Skip to content

Commit

Permalink
Fix empty preset element in ONVIF response (#36182)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjm authored and balloob committed May 28, 2020
1 parent 0865791 commit c710f99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homeassistant/components/onvif/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async def async_get_profiles(self) -> List[Profile]:
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 = []
Expand Down

0 comments on commit c710f99

Please sign in to comment.