From 789f21c427bb19df7cac560c1fc458d7c2597553 Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Mon, 6 Sep 2021 22:52:45 -0400 Subject: [PATCH] Fix assignment of amcrest camera model (#55266) --- homeassistant/components/amcrest/camera.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index 98dd15adcfb..12fec04ce9c 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -374,15 +374,16 @@ class AmcrestCam(Camera): try: if self._brand is None: resp = self._api.vendor_information.strip() + _LOGGER.debug("Assigned brand=%s", resp) if resp.startswith("vendor="): self._brand = resp.split("=")[-1] else: self._brand = "unknown" if self._model is None: resp = self._api.device_type.strip() - _LOGGER.debug("Device_type=%s", resp) - if resp.startswith("type="): - self._model = resp.split("=")[-1] + _LOGGER.debug("Assigned model=%s", resp) + if resp: + self._model = resp else: self._model = "unknown" if self._attr_unique_id is None: