mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-16 14:40:43 +08:00
feat: improve miot cloud logic
This commit is contained in:
parent
30b42276d5
commit
417514a22f
@ -47,6 +47,7 @@ MIoT http client.
|
|||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
@ -136,7 +137,9 @@ class MIoTOauthClient:
|
|||||||
'redirect_uri': redirect_url or self._redirect_url,
|
'redirect_uri': redirect_url or self._redirect_url,
|
||||||
'client_id': self._client_id,
|
'client_id': self._client_id,
|
||||||
'response_type': 'code',
|
'response_type': 'code',
|
||||||
'device_id': self._device_id
|
'device_id': self._device_id,
|
||||||
|
'state': hashlib.sha1(
|
||||||
|
f'd={self._device_id}'.encode('utf-8')).hexdigest()
|
||||||
}
|
}
|
||||||
if state:
|
if state:
|
||||||
params['state'] = state
|
params['state'] = state
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user