Fix Canary camera stream blocking call (#71369)
* fix: Canary stream camera, fix blocker fixes a "detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue for canary doing blocking calls at homeassistant/components/canary/camera.py, line 149: self._live_stream_session.live_stream_url, extra_cmd=self._ffmpeg_arguments" from log file. * refactor: black formatting changes tsia
This commit is contained in:
parent
6984c56cc6
commit
1a00bb9fc4
1 changed files with 4 additions and 3 deletions
|
@ -144,10 +144,11 @@ class CanaryCamera(CoordinatorEntity[CanaryDataUpdateCoordinator], Camera):
|
||||||
if self._live_stream_session is None:
|
if self._live_stream_session is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
stream = CameraMjpeg(self._ffmpeg.binary)
|
live_stream_url = await self.hass.async_add_executor_job(
|
||||||
await stream.open_camera(
|
getattr, self._live_stream_session, "live_stream_url"
|
||||||
self._live_stream_session.live_stream_url, extra_cmd=self._ffmpeg_arguments
|
|
||||||
)
|
)
|
||||||
|
stream = CameraMjpeg(self._ffmpeg.binary)
|
||||||
|
await stream.open_camera(live_stream_url, extra_cmd=self._ffmpeg_arguments)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stream_reader = await stream.get_reader()
|
stream_reader = await stream.get_reader()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue