mdz / python-smarttub

Python API for SmartTub enabled hot tubs
MIT License
6 stars 9 forks source link

Triad 36 by D1: TypeError: object of type 'NoneType' has no len() #22

Closed mdz closed 2 years ago

mdz commented 2 years ago

Originally reported by @gdeuss via https://github.com/home-assistant/home-assistant.io/issues/20896

*Unexpected error fetching smarttub data: object of type 'NoneType' has no len()
Logger: homeassistant.components.smarttub.controller
Source: components/smarttub/controller.py:98
Integration: SmartTub (documentation, issues)
First occurred: 10:51:14 AM (123 occurrences)
Last logged: 12:56:35 PM

Unexpected error fetching smarttub data: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
return await self.update_method()
File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 90, in async_update_data
data[spa.id] = await self._get_spa_data(spa)
File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 98, in _get_spa_data
full_status, reminders, errors = await asyncio.gather(
File "/usr/local/lib/python3.9/site-packages/smarttub/api.py", line 206, in get_reminders
return [
File "/usr/local/lib/python3.9/site-packages/smarttub/api.py", line 207, in
SpaReminder(self, **reminder_info)
File "/usr/local/lib/python3.9/site-packages/smarttub/api.py", line 469, in init
self.last_updated = dateutil.parser.isoparse(properties["lastUpdated"])
File "/usr/local/lib/python3.9/site-packages/dateutil/parser/isoparser.py", line 37, in func
return f(self, str_in, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/dateutil/parser/isoparser.py", line 134, in isoparse
components, pos = self._parse_isodate(dt_str)
File "/usr/local/lib/python3.9/site-packages/dateutil/parser/isoparser.py", line 208, in _parse_isodate
return self._parse_isodate_common(dt_str)
File "/usr/local/lib/python3.9/site-packages/dateutil/parser/isoparser.py", line 213, in _parse_isodate_common
len_str = len(dt_str)
TypeError: object of type 'NoneType' has no len()