def login(self):
"""Log in to the MyQ service."""
params = {
'username': self.username,
'password': self.password
}
login = requests.post(
'https://{host_uri}/{login_endpoint}'.format(
host_uri=HOST_URI,
login_endpoint=self.LOGIN_ENDPOINT),
json=params,
headers={
'MyQApplicationId': self.brand[APP_ID],
'User-Agent': self.USERAGENT
}
)
auth = login.json()
self.security_token = auth['SecurityToken']
self._logger.debug('Logged in to MyQ API')
return True
评论列表
文章目录