static void Main(string[] args)
 {
     var api        = new MyQApi();
     var result     = api.Login(Constants.Email, Constants.Password).Result;
     var garageDoor = api.GetDevices().Result.Where(x => x.DeviceFamily == "garagedoor").FirstOrDefault();
     var doorstate  = api.GetDoorState(garageDoor.SerialNumber).Result;
     var setting    = api.SetDoorState(garageDoor.SerialNumber, Constants.ActionClose).Result;
 }
Ejemplo n.º 2
0
        public async void GetDoorState(Device garageDoor)
        {
            doorState = await api.GetDoorState(garageDoor.SerialNumber);

            Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
            {
                UpdateUi(doorState);
            });
        }