Skip to content

Commit

Permalink
Merge pull request #72 from elad-bar/fix-3-0-11
Browse files Browse the repository at this point in the history
Fix errors introduced in v3.0.11 while trying to get results from API
  • Loading branch information
elad-bar authored Aug 7, 2024
2 parents 953772a + 71671f7 commit 679ce13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v3.0.12

- Fix errors introduced in v3.0.11 while trying to get results from API

## v3.0.11

- Add support for new monitor details format (as JSON, instead of string of JSON)
Expand Down
10 changes: 7 additions & 3 deletions custom_components/shinobi/managers/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,13 @@ async def _handle_response(

else:
response_data = await response.json()
valid_response = response_data.get("ok", False)

if valid_response:
if isinstance(response_data, dict):
valid_response = response_data.get("ok", False)

if valid_response:
result = response_data
else:
result = response_data

else:
Expand Down Expand Up @@ -453,7 +457,7 @@ async def _set_support_video_browser_api(self):
_LOGGER.debug("Set support flag for video browser API")

support_video_browser_api: bool = await self._async_get(
URL_VIDEO_WALL, resource_available_check=True
URL_VIDEO_WALL, request_type=RequestType.RESOURCE_CHECK
)

self._support_video_browser_api = support_video_browser_api
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 @@ -9,5 +9,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/elad-bar/ha-shinobi/issues",
"requirements": [],
"version": "3.0.11"
"version": "3.0.12"
}

0 comments on commit 679ce13

Please sign in to comment.