Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #52 from cpainchaud/main
Browse files Browse the repository at this point in the history
bugfix: reopen http session if it was closed
  • Loading branch information
cpainchaud authored Oct 17, 2021
2 parents 6f53235 + ad35fb0 commit ee974d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions reolink/camera_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,11 @@ def is_nvr(self):

async def send(self, body, param=None, expected_content_type: Optional[str] = None):
"""Generic send method."""

if self._aiohttp_session.closed:
self._aiohttp_session = aiohttp.ClientSession(timeout=self._timeout,
connector=aiohttp.TCPConnector(verify_ssl=False))

if body is None or (body[0]["cmd"] != "Login" and body[0]["cmd"] != "Logout"):
if not await self.login():
return False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='reolink',
packages=['reolink'],
version='0.0.30',
version='0.0.31',
license='MIT',
description='Reolink camera package',
author='fwestenberg',
Expand Down

0 comments on commit ee974d7

Please sign in to comment.