Beispiel #1
0
        public MainViewModel()
        {
            this.client = new HomeAutomation("", "ente51");

            this.Devices        = this.client.GetDeviceListInfos().Devices.Select(d => new DeviceViewModel(d)).ToList();
            this.SelectedDevice = this.Devices.FirstOrDefault();
        }
        public void SwitchActuatorTest()
        {
            string[] list = null;

            using (HomeAutomation client = new HomeAutomation("", ""))
            {
                list = client.GetSwitchListAsync().Result;
            }

            Assert.IsNotNull(list, "list");
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            string[] list = null;

            using (HomeAutomation client = new HomeAutomation("", ""))
            {
                list = client.GetSwitchListAsync().Result;

                var x = client.GetDeviceListInfosAsync().Result;
            }
        }
        // Important: This is just an example.
        // It is not secure. The system is wide open to the world
        public string Get(int id)
        {
            switch (id)
            {
            case 99999999: HomeAutomation.send_command("OFFICE_ON"); break;

            case 99999991: HomeAutomation.send_command("OFFICE_OFF"); break;

            case 77777771: HomeAutomation.send_command("OFFICE_SHADES_UP"); break;

            case 77777777: HomeAutomation.send_command("OFFICE_SHADES_DOWN"); break;

            case 77777770: HomeAutomation.send_command("OFFICE_SHADES_STOP"); break;
            }
            return("Done!");
        }