Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper methods to combine getXXXByLocation and getXXXByDevice into getXXX #33

Closed
kan-fu opened this issue Mar 15, 2024 · 0 comments · Fixed by #35
Closed

Add helper methods to combine getXXXByLocation and getXXXByDevice into getXXX #33

kan-fu opened this issue Mar 15, 2024 · 0 comments · Fixed by #35
Assignees

Comments

@kan-fu
Copy link
Collaborator

kan-fu commented Mar 15, 2024

We have several api endpoints (scalardata , rawdata, and archivefile) that support both byLocation and byDevice. The required format of the params are different.

  • byLocation: locationCode + deviceCategoryCode
  • byDevice: deviceCode

Whether byLocation or byDevice is intended can be inferred from the the given params. Just like how the getSensorCategoryCodes is implemented.

def getSensorCategoryCodes(self, filters: dict):
        filters["returnOptions"] = "excludeScalarData"
        if "deviceCode" in filters:
            return self.getDirectByDevice(filters, False)["sensorData"]
        else:
            return self.getDirectByLocation(filters, False)["sensorData"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant