Ejemplo n.º 1
0
        public async Task InitDevicesTest()
        {
            var smart = new SmartLife(email, password);
            await smart.Connect();

            await smart.InitDevices();

            Assert.IsNotNull(smart.Devices);
        }
Ejemplo n.º 2
0
        public async Task SwitchTest()
        {
            var smart = new SmartLife(email, password);
            await smart.Connect();

            await smart.InitDevices();

            var device = smart.Devices.FirstOrDefault(x => x is SmartLifeNet.Classes.SwitchDevice) as SmartLifeNet.Classes.SwitchDevice;
            await device?.SetState(1);
        }
Ejemplo n.º 3
0
        public async Task MultiSwitchTest()
        {
            var smart = new SmartLife(email, password);
            await smart.Connect();

            await smart.InitDevices();

            var device = smart.Devices.FirstOrDefault(x => x is SmartLifeNet.Classes.MultiSwitchDevice) as SmartLifeNet.Classes.MultiSwitchDevice;
            await device?.SetAllChannels(1);

            await Task.Delay(500);

            await device?.SetAllChannels(0);
        }