fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

Log filling with "Session is closed errors" #316

Closed drjjr2 closed 2 years ago

drjjr2 commented 2 years ago

Describe the bug home-assistant.log is logging "session is closed" errors.

To Reproduce unclear.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment: Please provide useful information about your environment, like:

Additional context

2021-10-16 19:26:42 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/reolink_dev/binary_sensor.py", line 105, in handle_event
    self._event_state = await self._base.api.get_motion_state()
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 420, in get_motion_state
    response = await self.send(body)
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1060, in send
    if not await self.login():
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 645, in login
    response = await self.send(body, param)
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1091, in send
    async with self._aiohttp_session.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 381, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed
drjjr2 commented 2 years ago

This seems to be fixed with v0.28