public ActionResult <string> StairsSensorDown()
        {
            Task.Factory.StartNew(async() =>
            {
                _logger.LogInformation("Executed stairs down sensor");
                await _rabbitManager.PublishAsync(new TriggeredBottomStairSensorModel {
                    DateTime = DateTime.Now
                });
            });

            return(Ok("Got sensor down info"));
        }
예제 #2
0
        public ActionResult <string> LevelChanged(int level)
        {
            new CoverLevelValidator().ValidateAndThrow(level);

            logger.LogInformation("Executed level changed");
            rabbitManager.PublishAsync(new CoverLevelChangedModel(level));

            return(Ok($"Got level changed: {level}"));
        }