Controls (light buttons and PTZ actions) are not working for binary protocol cameras. The connections is closed before the action.
async def close(self):
"""Close the connection to the device."""
if self.device._session is None or not self._connected_num:
self._connected_num = 0
return
self._connected_num -= 1
if self._connected_num == 0:
await self.device.close()
# ...
async def ensure_connected(self):
"""Ensure the device is connected."""
await self.connect()
try:
yield self
finally:
await self.close()
|
await self.device.close() |
If remove the close() method call, it works, but that's not a fix as the connection will never be closed.
Controls (light buttons and PTZ actions) are not working for binary protocol cameras. The connections is closed before the action.
pppp_camera/custom_components/pppp_camera/device.py
Line 76 in 958cfb5
If remove the
close()method call, it works, but that's not a fix as the connection will never be closed.