15.07.2019, 12:48
(This post was last modified: 15.07.2019, 13:05 by gjniewenhuijse.)
I think i need to get device information over HTTPS:
https://github.com/CharlesBlonde/libpure...k/dyson.py
result:
How to get the account and password value in the following GET request to receive al devices from: /provisioningservice/manifest
https://github.com/CharlesBlonde/libpure...k/dyson.py
Code:
https = require 'ssl.https'
require('json')
socket.http.TIMEOUT = 5
local cUsername = 'xxxxxxxxx@xxxxxxxx.nl'
local cPassword = 'xxxxxxxxxxxxxx'
-- get session info
local cBody = '{"Email":"' .. cUsername .. '","Password":"' .. cPassword ..'"}'
local cReq = {}
local cUrl1 = 'https://api.cp.dyson.com/v1/userregistration/authenticate?country=NL'
result1 = https.request({
url = cUrl1,
method = 'POST',
headers = {
['content-length'] = #cBody,
['content-type'] = 'application/json'
},
source = ltn12.source.string(cBody),
sink = ltn12.sink.table(cReq)
})
if result1 and cReq then
log(cReq)
cAuth = cReq
else
log(result1)
end
result:
Code:
* table:
[1]
* string: {"Account":"xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx","Password":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
How to get the account and password value in the following GET request to receive al devices from: /provisioningservice/manifest