The retrieving data from the OVO api, the code was assuming that all data would be present, which is not always the case. This change validates for each set of data that it is present before processing it.
I believe lack of data should be handled by the calling code, so this returns None if it is not present.
I have fixed this for electricity, but since I don't have gas at my property I don't have sample data to apply the same logic. Their maybe more pythonic ways of writing the code, so happy to have it corrected.
Description
The retrieving data from the OVO api, the code was assuming that all data would be present, which is not always the case. This change validates for each set of data that it is present before processing it.
I believe lack of data should be handled by the calling code, so this returns None if it is not present.
I have fixed this for electricity, but since I don't have gas at my property I don't have sample data to apply the same logic. Their maybe more pythonic ways of writing the code, so happy to have it corrected.
Related issues this fixes
https://github.com/timmo001/ovoenergy/issues/10
Checklist