mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Set unique id to amcrest serial number (#54675)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev> Co-authored-by: Franck Nijhof <frenck@frenck.nl> Co-authored-by: Sean Vig <sean.v.775@gmail.com>
This commit is contained in:
parent
4a6ca8a04e
commit
6cefd558d8
@ -365,10 +365,14 @@ class AmcrestCam(Camera):
|
||||
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]
|
||||
else:
|
||||
self._model = "unknown"
|
||||
if self._attr_unique_id is None:
|
||||
self._attr_unique_id = self._api.serial_number.strip()
|
||||
_LOGGER.debug("Assigned unique_id=%s", self._attr_unique_id)
|
||||
self.is_streaming = self._get_video()
|
||||
self._is_recording = self._get_recording()
|
||||
self._motion_detection_enabled = self._get_motion_detection()
|
||||
|
Loading…
x
Reference in New Issue
Block a user