mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +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."""
|
"""Camera Motion Detection Status."""
|
||||||
return self._caminfo["recordingSettings"]["motionRecordEnabled"]
|
return self._caminfo["recordingSettings"]["motionRecordEnabled"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self) -> str:
|
||||||
|
"""Return a unique identifier for this client."""
|
||||||
|
return self._uuid
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brand(self):
|
def brand(self):
|
||||||
"""Return the brand of this camera."""
|
"""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.uvc = uvc.UnifiVideoCamera(self.nvr, self.uuid, self.name, self.password)
|
||||||
self.nvr.get_camera.return_value = {
|
self.nvr.get_camera.return_value = {
|
||||||
"model": "UVC Fake",
|
"model": "UVC Fake",
|
||||||
|
"uuid": "06e3ff29-8048-31c2-8574-0852d1bd0e03",
|
||||||
"recordingSettings": {"fullTimeRecordEnabled": True},
|
"recordingSettings": {"fullTimeRecordEnabled": True},
|
||||||
"host": "host-a",
|
"host": "host-a",
|
||||||
"internalHost": "host-b",
|
"internalHost": "host-b",
|
||||||
@ -238,6 +239,7 @@ class TestUVC(unittest.TestCase):
|
|||||||
assert "Ubiquiti" == self.uvc.brand
|
assert "Ubiquiti" == self.uvc.brand
|
||||||
assert "UVC Fake" == self.uvc.model
|
assert "UVC Fake" == self.uvc.model
|
||||||
assert SUPPORT_STREAM == self.uvc.supported_features
|
assert SUPPORT_STREAM == self.uvc.supported_features
|
||||||
|
assert "uuid" == self.uvc.unique_id
|
||||||
|
|
||||||
def test_stream(self):
|
def test_stream(self):
|
||||||
"""Test the RTSP stream URI."""
|
"""Test the RTSP stream URI."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user