public async Task LightOnAll() { var actionToPerform = (int)Enums.HomeActions.LightOnAll; var bicServiceBus = new BicServiceBus(); await bicServiceBus.SendMessageToHome(actionToPerform); }
public async Task GetTemperature() { var actionToPerform = (int)Enums.HomeActions.GetTemperature; var bicServiceBus = new BicServiceBus(); await bicServiceBus.SendMessageToHome(actionToPerform); }
public async Task AuthyOneActionResult([FromBody] AuthyOneClientCallbackResult req) { var mensajeBot = string.Empty; if (req.status == "approved") { mensajeBot = "La solicitud ha sido aprobada"; var authyRegister = _context.AuthyAuthorization.Where(authy => authy.AuthyIdentifier == req.uuid).FirstOrDefault(); if (authyRegister != null) { int actionToPerform = 0; var bicServiceBus = new BicServiceBus(); // Encender luz if (authyRegister.AcionToExecute == "encenderluzbaño") { actionToPerform = (int)Enums.HomeActions.LightOnBathRoom; await this.sendBotMessage("Encendida luz del baño ok "); } if (authyRegister.AcionToExecute == "encenderluzcocina") { actionToPerform = (int)Enums.HomeActions.LightOnKitchen; await this.sendBotMessage("Encendida luz de la cocina"); } if (authyRegister.AcionToExecute == "encenderluzrecibidor") { actionToPerform = (int)Enums.HomeActions.LightOnEntranceHall; await this.sendBotMessage("Encendida luz del recibidor"); } if (authyRegister.AcionToExecute == "encenderluzhabitacion") { actionToPerform = (int)Enums.HomeActions.LightOnBedroom; await this.sendBotMessage("Encendida luz de la habitación"); } //apagar luz if (authyRegister.AcionToExecute == "apagarluzbaño") { actionToPerform = (int)Enums.HomeActions.LightOffBathRoom; await this.sendBotMessage("Apagada luz del baño"); } if (authyRegister.AcionToExecute == "apagarluzcocina") { actionToPerform = (int)Enums.HomeActions.LightOffKitchen; await this.sendBotMessage("Apagada luz de la cocina"); } if (authyRegister.AcionToExecute == "apagarluzrecibidor") { actionToPerform = (int)Enums.HomeActions.LightOffEntranceHall; await this.sendBotMessage("Apagada luz del recibidor"); } if (authyRegister.AcionToExecute == "apagarluzhabitacion") { actionToPerform = (int)Enums.HomeActions.LightOffBedroom; await this.sendBotMessage("Apagada luz de la habitación"); } if (authyRegister.AcionToExecute == "entregarpaquetecartero") { actionToPerform = (int)Enums.HomeActions.MailUser; await this.sendBotMessage("Buzón abierto para depositar el paquete"); } if (authyRegister.AcionToExecute == "entregarpaquetecartero") { await bicServiceBus.SendMessageBlindToHome(actionToPerform); } else { await bicServiceBus.SendMessageToHome(actionToPerform); } } } else { mensajeBot = "La solicitud ha sido rechazada"; } }