mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00: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):
|
def set_motion_detection(self, mode):
|
||||||
"""Set motion detection on or off."""
|
"""Set motion detection on or off."""
|
||||||
|
set_mode = "motion" if mode is True else "none"
|
||||||
if mode is True:
|
|
||||||
set_mode = "motion"
|
|
||||||
else:
|
|
||||||
set_mode = "none"
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._nvr.set_recordmode(self._uuid, set_mode)
|
self._nvr.set_recordmode(self._uuid, set_mode)
|
||||||
@ -215,9 +211,7 @@ class UnifiVideoCamera(Camera):
|
|||||||
|
|
||||||
async def stream_source(self):
|
async def stream_source(self):
|
||||||
"""Return the source of the stream."""
|
"""Return the source of the stream."""
|
||||||
caminfo = self._nvr.get_camera(self._uuid)
|
for channel in self._caminfo["channels"]:
|
||||||
channels = caminfo["channels"]
|
|
||||||
for channel in channels:
|
|
||||||
if channel["isRtspEnabled"]:
|
if channel["isRtspEnabled"]:
|
||||||
return channel["rtspUris"][0]
|
return channel["rtspUris"][0]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user