koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
3.91k stars 237 forks source link

server: treat self.device as future #1401

Closed bjia56 closed 3 months ago

bjia56 commented 3 months ago

Repro in a Python REPL:

d = systemManager.getDeviceByName("MyCamera")
await d.getVideoStreamOptions()
await d.getVideoStreamOptions()

Gives error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/brettjia/workspace/scrypted/server/python/plugin_remote.py", line 87, in apply
    device = await self.device
RuntimeError: cannot reuse already awaited coroutine