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

Add None checking in refresh sensors #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaminh
Copy link

@jaminh jaminh commented Feb 2, 2022

I think this should help with the issue reported here #6. I have seen similar issues on my homeassistant install as well.

'NoneType' object has no attribute 'text'
Traceback (most recent call last):
File "/srv/homeassistant/lib64/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/srv/homeassistant/lib64/python3.9/site-packages/homeassistant/components/iotawatt/coordinator.py", line 65, in _async_update_data
await self.api.update(lastUpdate=self._last_run)
File "/srv/homeassistant/lib64/python3.9/site-packages/iotawattpy/iotawatt.py", line 76, in update
await self._refreshSensors(timespan, lastUpdate)
File "/srv/homeassistant/lib64/python3.9/site-packages/iotawattpy/iotawatt.py", line 154, in _refreshSensors
results = response.text
AttributeError: 'NoneType' object has no attribute 'text'

@mikey0000
Copy link

@gtdiehl any reason this can't be merged?

@mikey0000
Copy link

@gtdiehl pretty please!?

@agners agners mentioned this pull request Jan 19, 2023
@F13
Copy link

F13 commented Jan 19, 2023

The root cause of this is just that the default timeout is sometimes too short for the IoTaWatt. Perhaps that would be a more useful error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants