The current design is a bit weird and makes it awkwardly complicated to perform a part of the fetching pipeline to, e.g., receive the raw JSON data (see #25 )
Part of the issue is that the current design is already unneccessarily complicated by passing in the Fronius.* callbacks to current_data. I think it would be much more straightforward to understand if we instead split the functions like this
current_power_flow calls _current_power_flow_raw and processes the results using Fronius._system_power_flow
_current_power_flow_raw calls _current_data with the relevant parameters to return the raw json
_current_data is rewritten such that it just calls the API and returns the raw json
The current design is a bit weird and makes it awkwardly complicated to perform a part of the fetching pipeline to, e.g., receive the raw JSON data (see #25 )
Part of the issue is that the current design is already unneccessarily complicated by passing in the Fronius.* callbacks to current_data. I think it would be much more straightforward to understand if we instead split the functions like this
current_power_flowcalls_current_power_flow_rawand processes the results usingFronius._system_power_flow_current_power_flow_rawcalls_current_datawith the relevant parameters to return the raw json_current_datais rewritten such that it just calls the API and returns the raw json