示例#1
0
文件: UnitTest1.cs 项目: jbct/LonoNet
        public void TestMethod1()
        {
            LonoNetClient client = new LonoNetClient(_clientId, _clientSecret, _authToken, _deviceId);
            var login = client.GetAccessToken(_authCode);

            ZoneState zs = client.GetActiveZone();
            ZoneInfo zi = client.GetAllZones();
            DeviceInfo di = client.GetDeviceInfo();
            client.SetZone(1, true);
            Thread.Sleep(10);
            client.SetZone(1, false);
        }
示例#2
0
文件: UnitTest1.cs 项目: jbct/LonoNet
        public void TestMethod2()
        {
            LonoNetClient client = new LonoNetClient(_clientId, _clientSecret, _deviceId);
            string url = client.BuildAuthorizationUrl("http://localhost", "write");
            // Launch url
            // set _authCode to value returned in url
            var login = client.GetAccessToken(_authCode);

            ZoneState zs = client.GetActiveZone();
            ZoneInfo zi = client.GetAllZones();
            DeviceInfo di = client.GetDeviceInfo();
            client.SetZone(1, true);
            Thread.Sleep(10);
            client.SetZone(1, false);
        }