|
|
|
@ -417,7 +417,7 @@ namespace IoTCenter.Controllers
|
|
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
|
|
|
|
|
|
public IActionResult Power(string token,string connectionId, string method,string[] numbers)
|
|
|
|
|
public IActionResult Power(string token, string connectionId, string method, string[] numbers)
|
|
|
|
|
{
|
|
|
|
|
var userName = this.GetUserName(token);
|
|
|
|
|
if (string.IsNullOrEmpty(userName))
|
|
|
|
@ -461,7 +461,7 @@ namespace IoTCenter.Controllers
|
|
|
|
|
{
|
|
|
|
|
var api = device.Product.Apis.FirstOrDefault(o => o.Command == command);
|
|
|
|
|
var message = $"{api.Path}{api.Command}?number={device.Number}";
|
|
|
|
|
this._hub.Clients.Group(device.Node.Number).SendAsync(Methods.ServerToClient, Methods.ExecApiRequest, message, connectionId);
|
|
|
|
|
this._hub.ServerToClient(Methods.ExecApiRequest, message, device.Node.Number, connectionId);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|