Skip to content

Commit

Permalink
Add potential fix for cases when aiohttp throws `server disconnecte…
Browse files Browse the repository at this point in the history
…d` error while the server is up and running
  • Loading branch information
elad-bar committed Nov 28, 2022
1 parent efb77fe commit d55d7ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 2.0.28

- Add potential fix for cases when `aiohttp` throws `server disconnected` error while the server is up and running, based on [aiohttp issue #4549](https://github.com/aio-libs/aiohttp/issues/4549)

## 2.0.27

- Fix extraction of days to keep video files when settings were not changed (default) [#39](https://github.com/elad-bar/ha-shinobi/issues/39)
- [Fix extraction of days to keep video files when settings were not changed (default)]() [#39](https://github.com/elad-bar/ha-shinobi/issues/39)

## 2.0.26

Expand Down
4 changes: 4 additions & 0 deletions custom_components/shinobi/component/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ async def _async_post(self,
f"Failed to post JSON to {endpoint}, Error: {ex}, Line: {line_number}"
)

await sleep(0.001)

return result

async def _async_get(self, endpoint, monitor_id: str = None, resource_available_check: bool = False):
Expand Down Expand Up @@ -224,6 +226,8 @@ async def _async_get(self, endpoint, monitor_id: str = None, resource_available_
f"Failed to get data from {endpoint}, Error: {ex}, Line: {line_number}"
)

await sleep(0.001)

return result

async def async_update(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/shinobi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"codeowners": ["@elad-bar"],
"requirements": [ ],
"config_flow": true,
"version": "2.0.27",
"version": "2.0.28",
"iot_class": "local_polling"
}

0 comments on commit d55d7ae

Please sign in to comment.