Skip to content
Permalink
Browse files

making method return true / false

  • Loading branch information...
sander76 committed Oct 16, 2018
1 parent bd64c23 commit 0b61954f6accf773a32cf91772b0a5b1bb7ef4ac
Showing with 6 additions and 2 deletions.
  1. +6 −2 homematicip/aio/auth.py
@@ -36,12 +36,16 @@ def __init__(self, loop, websession=None):
data = {"deviceId": self.uuid, "deviceName": devicename, "sgtin": self.accesspoint}
if self.pin != None:
self._connection.headers["PIN"] = self.pin
json_state = await self._connection.api_call('auth/connectionRequest', json.dumps(data))
json_state = await self._connection.api_call('auth/connectionRequest', json.dumps(data))
return json_state

async def isRequestAcknowledged(self):
data = {"deviceId": self.uuid}
return await self._connection.api_call('auth/isRequestAcknowledged', json.dumps(data))
try:
await self._connection.api_call('auth/isRequestAcknowledged', json.dumps(data))
return True
except HmipWrongHttpStatusError:
return False

async def requestAuthToken(self):
data = {"deviceId": self.uuid}

0 comments on commit 0b61954

Please sign in to comment.
You can’t perform that action at this time.