Пример #1
0
        public ActionResult On(DeviceOld device)
        {
            SlapsteonFacade facade = new SlapsteonFacade();
            facade.On(device.Name);

            return RedirectToAction("Index", "Home");
        }
Пример #2
0
        public ActionResult List()
        {
            List<SlapsteonDevice> devices = (new SlapsteonFacade()).GetDevices();

            List<DeviceOld> deviceList = new List<DeviceOld>();

            foreach (SlapsteonDevice dev in devices)
            {
                int level;
                int.TryParse(dev.Status, out level);
                DeviceOld device = new DeviceOld();
                device.Address = dev.Address;
                device.Status = level;
                device.Name = dev.Name;
                device.LastOff = dev.LastOff;
                device.LastOn = dev.LastOn;
                device.IsFan = dev.IsFan;
                device.IsPLM = dev.IsPLM;
                device.IsDimmable = dev.IsDimmable;
                deviceList.Add(device);
            }

            DeviceList deviceListModel = new DeviceList(deviceList);

            return DeviceListView(deviceListModel);
        }