In get_stats() on main:
info, sw_data = await asyncio.gather(*tasks)
data = info["runtimeData"] # TypeError when info is None
if data is None: # the guard is one line too late
raise InvalidDataException
get_composite_info() returns (await self._get(url, params))["result"], which is None when the API replies result: null — seen intermittently on working accounts (richo/homeassistant-franklinwh#82, and reproduced on mine). Callers get TypeError: 'NoneType' object is not subscriptable instead of InvalidDataException.
data = info.get("runtimeData") if info else None before the check fixes it.
In
get_stats()onmain:get_composite_info()returns(await self._get(url, params))["result"], which isNonewhen the API repliesresult: null— seen intermittently on working accounts (richo/homeassistant-franklinwh#82, and reproduced on mine). Callers getTypeError: 'NoneType' object is not subscriptableinstead ofInvalidDataException.data = info.get("runtimeData") if info else Nonebefore the check fixes it.