Exemple #1
0
        public IActionResult OnPostDoorAction(string data)
        {
            var device = new IoTService(serviceConnStr);

            switch (data)
            {
            case "up":
                device.DoorUp();
                break;

            case "down":
                device.DoorDown();
                break;

            case "stop":
                device.DoorStop();
                break;

            default:
                return(BadRequest());
            }

            return(Page());
        }
        public void DoorStop()
        {
            var iotService = new IoTService(ConnStr);

            iotService.DoorStop();
        }