Fix assignment of amcrest camera model (#55266)

This commit is contained in:
Sean Vig 2021-09-06 22:52:45 -04:00 committed by GitHub
parent 9da3fa5d75
commit 789f21c427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: