mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-16 07:10:09 -07:00
Fetch gateway data
This commit is contained in:
commit
7cd0ce0ff1
21
wideq.py
Normal file
21
wideq.py
Normal file
@ -0,0 +1,21 @@
|
||||
import requests
|
||||
|
||||
GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList'
|
||||
APP_KEY = 'wideq'
|
||||
SECURITY_KEY = 'nuts_securitykey'
|
||||
DATA_ROOT = 'lgedmRoot'
|
||||
|
||||
|
||||
def gateway_info(country='US', lang='en-US'):
|
||||
req_data = {DATA_ROOT: {'countryCode': country, 'langCode': lang}}
|
||||
headers = {
|
||||
'x-thinq-application-key': APP_KEY,
|
||||
'x-thinq-security-key': SECURITY_KEY,
|
||||
'Accept': 'application/json',
|
||||
}
|
||||
res = requests.post(GATEWAY_URL, json=req_data, headers=headers)
|
||||
return res.json()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(gateway_info())
|
Loading…
x
Reference in New Issue
Block a user