mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Use the camera UUID as the entity unique id (#44937)
This commit is contained in:
parent
4de9f5194f
commit
1402e7ae56
@ -119,6 +119,11 @@ class UnifiVideoCamera(Camera):
|
||||
"""Camera Motion Detection Status."""
|
||||
return self._caminfo["recordingSettings"]["motionRecordEnabled"]
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return a unique identifier for this client."""
|
||||
return self._uuid
|
||||
|
||||
@property
|
||||
def brand(self):
|
||||
"""Return the brand of this camera."""
|
||||
|
@ -197,6 +197,7 @@ class TestUVC(unittest.TestCase):
|
||||
self.uvc = uvc.UnifiVideoCamera(self.nvr, self.uuid, self.name, self.password)
|
||||
self.nvr.get_camera.return_value = {
|
||||
"model": "UVC Fake",
|
||||
"uuid": "06e3ff29-8048-31c2-8574-0852d1bd0e03",
|
||||
"recordingSettings": {"fullTimeRecordEnabled": True},
|
||||
"host": "host-a",
|
||||
"internalHost": "host-b",
|
||||
@ -238,6 +239,7 @@ class TestUVC(unittest.TestCase):
|
||||
assert "Ubiquiti" == self.uvc.brand
|
||||
assert "UVC Fake" == self.uvc.model
|
||||
assert SUPPORT_STREAM == self.uvc.supported_features
|
||||
assert "uuid" == self.uvc.unique_id
|
||||
|
||||
def test_stream(self):
|
||||
"""Test the RTSP stream URI."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user