jrester/tesla_powerwall

_parse_uptime_seconds fails when the gateway is restarted

esev opened this issue · 1 comments

esev commented

_parse_uptime_seconds expects this regex, however the response does not have a value in the hours position.

r"((?P<hours>\d+?)h)((?P<minutes>\d+?)m)((?P<seconds>\d+?).)((?P<microseconds>\d+?)s)"

File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/init.py", line 362, in detect_and_pin_version
status = self.get_status()
File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/init.py", line 241, in get_status
self._get("status"), no_check=self._dont_validate_response
File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/responses.py", line 25, in init
self._set_attrs(no_check)
File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/responses.py", line 34, in _set_attrs
self._add_attr(attr, missing_attrs)
File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/responses.py", line 63, in _add_attr
setattr(self, key, constructor(self.json_response[key]))
File "/usr/local/lib/python3.7/site-packages/tesla_powerwall/responses.py", line 233, in _parse_uptime_seconds
"Unable to parse up time seconds {}".format(up_time_seconds)
ValueError: Unable to parse up time seconds 9m59.055751434s

Oh ups, I will fix it as soon as possible!