Skip to content

Refactor the callback-based design #26

@nielstron

Description

@nielstron

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions