mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 01:31:19 +00:00
Arlo service init + Test commit from Thelis
This commit is contained in:
parent
0441baa6b2
commit
8da2ae56df
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
MyCore/bin
|
||||
MyCore/obj
|
||||
.vs
|
||||
11
MyCore/Services/ArloService.cs
Normal file
11
MyCore/Services/ArloService.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MyCore.Services
|
||||
{
|
||||
public class ArloService
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -69,23 +69,28 @@ namespace MyCore.Services
|
||||
|
||||
try
|
||||
{
|
||||
// LOGIN
|
||||
var loginTask = Task.Run(() => PostURI(new Uri(_loginUrl), RequestType.Login));
|
||||
loginTask.Wait();
|
||||
|
||||
if (loginTask.Result != "")
|
||||
{
|
||||
//RESULT TOKEN
|
||||
var data = ((JObject)JsonConvert.DeserializeObject(loginTask.Result))["data"];
|
||||
resultToken = JsonConvert.DeserializeObject<ResultToken>(data.ToString());
|
||||
|
||||
// GET DEVICE LIST
|
||||
var deviceTask = Task.Run(() => PostURI(new Uri(_devList), RequestType.DeviceList));
|
||||
deviceTask.Wait();
|
||||
|
||||
if (deviceTask.Result != "")
|
||||
{
|
||||
data = ((JObject)JsonConvert.DeserializeObject(deviceTask.Result))["data"];
|
||||
// RETRIEVE ALL DEVICES
|
||||
allDevices = JsonConvert.DeserializeObject<List<MerossDevice>>(data.ToString());
|
||||
}
|
||||
|
||||
// RETRIEVE LOG
|
||||
var logTask = Task.Run(() => PostURI(new Uri(_logUrl), RequestType.Log));
|
||||
logTask.Wait();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user