myq.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:Home-Assistant 作者: jmart518 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号