From b5c8b5b91f763545f79feb41ed383667f0401084 Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Fri, 13 Mar 2020 22:58:14 +0000 Subject: [PATCH] Fix onvif error with non ptz cameras (#32783) --- homeassistant/components/onvif/camera.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/onvif/camera.py b/homeassistant/components/onvif/camera.py index 614eb4e655..ce241f779b 100644 --- a/homeassistant/components/onvif/camera.py +++ b/homeassistant/components/onvif/camera.py @@ -375,7 +375,7 @@ class ONVIFHassCamera(Camera): def setup_ptz(self): """Set up PTZ if available.""" _LOGGER.debug("Setting up the ONVIF PTZ service") - if self._camera.get_service("ptz") is None: + if self._camera.get_service("ptz", create=False) is None: _LOGGER.debug("PTZ is not available") else: self._ptz_service = self._camera.create_ptz_service()