Fix dangling task for homekit (#88289)
This commit is contained in:
@@ -443,7 +443,9 @@ class Camera(HomeAccessory, PyhapCamera):
|
||||
async def stop(self):
|
||||
"""Stop any streams when the accessory is stopped."""
|
||||
for session_info in self.sessions.values():
|
||||
asyncio.create_task(self.stop_stream(session_info))
|
||||
self.hass.async_create_background_task(
|
||||
self.stop_stream(session_info), "homekit.camera-stop-stream"
|
||||
)
|
||||
await super().stop()
|
||||
|
||||
async def stop_stream(self, session_info):
|
||||
|
||||
Reference in New Issue
Block a user