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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Toon expires_in value to float #37716

Merged
merged 2 commits into from
Jul 13, 2020
Merged
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
6 changes: 5 additions & 1 deletion homeassistant/components/toon/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ async def _token_request(self, data: dict) -> dict:

resp = await session.post(self.token_url, data=data, headers=headers)
resp.raise_for_status()
return cast(dict, await resp.json())
resp_json = cast(dict, await resp.json())
# The Toon API returns "expires_in" as a string for some tenants.
# This is not according to OAuth specifications.
resp_json["expires_in"] = float(resp_json["expires_in"])
frenck marked this conversation as resolved.
Show resolved Hide resolved
frenck marked this conversation as resolved.
Show resolved Hide resolved
return resp_json