Skip to content

Commit

Permalink
add version API to retrieve basic hub information (and a cheap way to… (
Browse files Browse the repository at this point in the history
#6)

* add version API to retrieve basic hub information (and a cheap way to test token is valid)

* revert version change per PR feedback
  • Loading branch information
prystupa authored Jul 6, 2020
1 parent 4d9e9eb commit aa0b0a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bond/bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ def doAction(self, deviceId, action, payload={}):
raise Exception(r.content)
return r.content

def getVersion(self):
url = f"http://{self.bondIp}/v2/sys/version"
headers = {'BOND-Token': self.bondToken}

r = requests.get(url, headers=headers)
return r.json()

def getDeviceIds(self):
url = f"http://{self.bondIp}/v2/devices"
headers = {'BOND-Token': self.bondToken}
Expand Down

0 comments on commit aa0b0a2

Please sign in to comment.