Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Loading