Esempio n. 1
0
        public async Task TestDeviceListInfos()
        {
            SessionInfo session = new SessionInfo(TestCredentials.USERNAME, TestCredentials.PASSWORD, TestCredentials.HOSTNAME);
            await session.AuthenticateAsync();

            var result = await session.GetDeviceListInfosAsync();

            Assert.IsTrue(result.Device.Count > 0);
        }
Esempio n. 2
0
        public async Task TestSetSimpleOnOffAsync()
        {
            SessionInfo session = new SessionInfo(TestCredentials.USERNAME, TestCredentials.PASSWORD, TestCredentials.HOSTNAME);
            await session.AuthenticateAsync();

            var deviceList = await session.GetDeviceListInfosAsync();

            var compatibleDevice = deviceList.Device.FirstOrDefault(d => d.SimpleOnOff != null);

            if (compatibleDevice == null)
            {
                Assert.Fail("No compatible device found!");
            }
            else
            {
                var result = await session.SetSimpleOnOffAsync(compatibleDevice.Identifier, SimpleOnOffStates.Toggle);
            }
        }