This function checks if the dictionary (aka the variable we are trying to access) is None, and if it is, it returns the default value (which is 0 by default, and means it should not be calculated against). If the dictionary is not None, it proceeds to fetch the value using .get() and passes it to process_value.
This should resolve the issue of where we were trying to modify a None value (e.g. _pvpowerdetails itself is None, meaning we were trying to call .get("ppv1") on a NoneType object), which leads to an AttributeError.
This function checks if the dictionary (aka the variable we are trying to access) is None, and if it is, it returns the default value (which is 0 by default, and means it should not be calculated against). If the dictionary is not None, it proceeds to fetch the value using .get() and passes it to process_value.
This should resolve the issue of where we were trying to modify a None value (e.g. _pvpowerdetails itself is None, meaning we were trying to call .get("ppv1") on a NoneType object), which leads to an AttributeError.