コード例 #1
0
 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;
 }
コード例 #2
0
        public async void GetDoorState(Device garageDoor)
        {
            doorState = await api.GetDoorState(garageDoor.SerialNumber);

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