Skip to content

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

Closed
@kan-fu

Description

@kan-fu

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"]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions