mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +02:00
Fix UVC doing I/O inside the event loop (#35169)
This commit is contained in:
parent
f885e97a5b
commit
a3071571ac
@ -192,11 +192,7 @@ class UnifiVideoCamera(Camera):
|
||||
|
||||
def set_motion_detection(self, mode):
|
||||
"""Set motion detection on or off."""
|
||||
|
||||
if mode is True:
|
||||
set_mode = "motion"
|
||||
else:
|
||||
set_mode = "none"
|
||||
set_mode = "motion" if mode is True else "none"
|
||||
|
||||
try:
|
||||
self._nvr.set_recordmode(self._uuid, set_mode)
|
||||
@ -215,9 +211,7 @@ class UnifiVideoCamera(Camera):
|
||||
|
||||
async def stream_source(self):
|
||||
"""Return the source of the stream."""
|
||||
caminfo = self._nvr.get_camera(self._uuid)
|
||||
channels = caminfo["channels"]
|
||||
for channel in channels:
|
||||
for channel in self._caminfo["channels"]:
|
||||
if channel["isRtspEnabled"]:
|
||||
return channel["rtspUris"][0]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user