Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #63 from IvanPenyaHuguet/master
Browse files Browse the repository at this point in the history
Solve camera connection lose after reboot
  • Loading branch information
fwestenberg authored Aug 23, 2020
2 parents dcde6d7 + 6a73273 commit 29bbe6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/reolink_dev/ReolinkPyPi/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,6 @@ async def send(self, body, param, stream=False):
async with session.post(url=self._url, json=body, params=param) as response:
json_data = await response.text()
return json_data

def clear_token(self):
self._token = None
1 change: 1 addition & 0 deletions custom_components/reolink_dev/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ async def async_update(self):

except Exception as ex:
_LOGGER.error(f"Got exception while fetching the state: {ex}")
self._reolinkSession.clear_token()

async def disconnect(self, event):
_LOGGER.info("Disconnecting from Reolink camera")
Expand Down

0 comments on commit 29bbe6d

Please sign in to comment.