Skip to content

Commit

Permalink
Merge pull request #1 from jaks6/patch-1
Browse files Browse the repository at this point in the history
Fix bug with type param for "devices" query
  • Loading branch information
SilverLaius authored Nov 6, 2020
2 parents e387105 + 35715c7 commit bcee7aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cumulocitypython/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_events(self, date_from=None, date_to=None, device_id=None, event_type=No
return pd.DataFrame([self.__flatten(e) for e in data])

def get_devices(self, device_type=None, fragment_type=None, ids=None, text=None, query=None, page_size=2000):
device_type_param = "&deviceType=%s" % device_type if device_type else ""
device_type_param = "&type=%s" % device_type if device_type else ""
fragment_type_param = "&fragmentType=%s" % fragment_type if fragment_type else ""
ids_param = "&ids=%s" % ",".join([str(i) for i in ids]) if ids else ""
query_param = "&query=%s" % query if query else ""
Expand All @@ -184,4 +184,4 @@ def get_devices(self, device_type=None, fragment_type=None, ids=None, text=None,
data = self.__fetch_all_data_pages(request_url, "managedObjects", "devices")

#flatten multi level json structure to one dimension dictionary
return pd.DataFrame([self.__flatten(m) for m in data])
return pd.DataFrame([self.__flatten(m) for m in data])

0 comments on commit bcee7aa

Please sign in to comment.