Fix Canary camera stream blocking call#71369
Fix Canary camera stream blocking call#71369balloob merged 2 commits intohome-assistant:devfrom 0bmay:dev
Conversation
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.
|
If you are fixing the code of the library, might be an idea to get rid of properties that do I/O. So easy to get it wrong. |
|
@balloob, the fix that I submitted was the only property that does any type of I/O.. I'll see if I can refactor to make it more clean. |
|
Confirming this works with Canary Flex and Canary Pro. Can't really do much else because I'm afraid I'm going to mess something up lol |
|
Thanks @BlockArchitech! I don't have a flex to test with, so this is great news! |
|
Yeah, no problem. From what I know, flex and pro use the same streaming. Cannot say same about view as i don't have one. sent using GitHub mobile |
|
I must have done something wrong... not sure how the codecov/patch error is dinging my pull request erroring on files I didn't touch.. |
|
I'm going to redo this pull request... and make changes in a specific branch. Sorry for the trouble... |
|
@0bmay thats an issue on our end. This PR is good to go! |
|
@balloob ok! I know better for next time, so it was a good learning experience on the HA workflow. Thanks! |
* 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
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.
Proposed change
While fixing the py-canary code to work after Canary changed return data from their API calls, tesitng the live video stream of the Canary Pro camera logged an error in the HA logs, requesting that the call be put in an await self.hass.async_add_executor_job call. So I changed the code to do so and the video stream worked as expected.
Type of change
Additional information
Checklist
black --fast homeassistant tests)The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: