-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
TypeError: 'NoneType' object is not subscriptable #91
Comments
Fixes #91 Check if user session exists --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/yo-han/Home-Assistant-Carelink/issues/91?shareId=XXXX-XXXX-XXXX-XXXX).
It seems there is no user session when checking for the role of the account. I made a small change to log an error when this happens instead of crashing. Maybe this helps. |
Thanks. The error is gone away, but got new: |
This is just a syntax warning and nothing that should break the app. I will fix it still, because not exactly what you would like. |
I'd like to connect my device and get the data 😄 Detected blocking call to open with args ('custom_components/carelink/logindata.json', 'r') inside the event loop by custom integration 'carelink' at custom_components/carelink/api.py, line 406: token_data = json.loads(open(filename, "r").read()) (offender: /config/custom_components/carelink/api.py, line 406: token_data = json.loads(open(filename, "r").read())) |
Hi all,
We get this error after install and setup:
Unexpected error fetching carelink data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/carelink/init.py", line 161, in _async_update_data
recent_data = await self.client.get_recent_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/carelink/api.py", line 390, in get_recent_data
if self.__session_user["role"]
~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
What should be the problem?
Thanks,
Gábor
The text was updated successfully, but these errors were encountered: