Previously, the try block in _parse_unit(raw_unit) was outside of the for loop. That meant that as soon as a missing key was encountered, the function stopped iterating through subsequent keys, leading to a partial unit dict, even if more desired fields were present in the original raw_unit.
These two factors combined could lead to unit parsing that sometimes worked and sometimes didn't. (e.g. if 'address' was missing and iterated through first, a completely empty unit dict would be returned).
Previously, the try block in _parse_unit(raw_unit) was outside of the for loop. That meant that as soon as a missing key was encountered, the function stopped iterating through subsequent keys, leading to a partial unit dict, even if more desired fields were present in the original raw_unit.
Additionally, iteration over the 'fields' set is non-deterministic because Python set iteration is based on a random hash seed.
These two factors combined could lead to unit parsing that sometimes worked and sometimes didn't. (e.g. if 'address' was missing and iterated through first, a completely empty unit dict would be returned).
May fix: https://github.com/dlarrick/hass-kumo/issues/109