Closed theOrakle closed 1 year ago
Wrote a quick script to test with my details and a get an access token responded.
import requests
import json
url = "https://auth.bouncie.com/oauth/token"
creds = {
"client_id": "14671homeassistant",
"client_secret": "9Y-Redacted-XG",
"grant_type": "authorization_code",
"code": "WD-Redacted-k3Yvn",
"redirect_uri": "https://47-redacted4.ui.nabu.casa"
}
try:
req = requests.post(url,json=creds)
results = req.json()
except:
print('Troubles talking to the API')
print(json.dumps(results,indent=3))
The trailing / in the url was killing it...
Describe the bug Not able to add integration
2023-02-10 08:32:44.872 ERROR (MainThread) [custom_components.bouncie.const] 'NoneType' object is not subscriptable Traceback (most recent call last): File "/opt/homeassistant/config/custom_components/bouncie/config_flow.py", line 61, in async_step_user info = await validate_input(self.hass, user_input) File "/opt/homeassistant/config/custom_components/bouncie/config_flow.py", line 37, in validate_input result = await bouncie_client.get_access_token() File "/opt/homeassistant/3.10.8/lib/python3.10/site-packages/bounciepy/async_rest_api_client.py", line 85, in get_access_token self._set_access_token(access_token=data["access_token"]) TypeError: 'NoneType' object is not subscriptable 2023-02-10 08:32:44.875 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session 2023-02-10 08:32:44.878 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector
To Reproduce
Expected behavior
Integration added
Screenshots
Configuration Home Assistant 2023.2.3 Frontend 20230202.0 - latest Python 3.10.8
Additional context Not that I can think of