|
|
|
@ -104,6 +104,7 @@ namespace IoT.Shared.DeviceServices.FBee
|
|
|
|
|
}
|
|
|
|
|
using (var scope = _applicationServices.CreateScope())
|
|
|
|
|
{
|
|
|
|
|
var nodeService = scope.ServiceProvider.GetService<NodeService>();
|
|
|
|
|
var categoryRepo = scope.ServiceProvider.GetService<IRepository<Category>>();
|
|
|
|
|
var productNumber = "fbee:gateway";
|
|
|
|
|
var productRepo = scope.ServiceProvider.GetService<IRepository<Product>>();
|
|
|
|
@ -116,7 +117,7 @@ namespace IoT.Shared.DeviceServices.FBee
|
|
|
|
|
Number = productNumber,
|
|
|
|
|
Name = "FBee网关",
|
|
|
|
|
Icon = "gateway",
|
|
|
|
|
ApiJson = this.GetApiJson("/Gateway/"),
|
|
|
|
|
ApiJson = nodeService.GetApiJson("/Gateway/"),
|
|
|
|
|
CategoryId = category.Id
|
|
|
|
|
};
|
|
|
|
|
OpenApiService.UpdateApi(product);
|
|
|
|
@ -425,6 +426,7 @@ namespace IoT.Shared.DeviceServices.FBee
|
|
|
|
|
var endpoint = ms.ReadByte();
|
|
|
|
|
using (var scope = _applicationServices.CreateScope())
|
|
|
|
|
{
|
|
|
|
|
var nodeService = scope.ServiceProvider.GetService<NodeService>();
|
|
|
|
|
var profileId = ms.ReadInt();
|
|
|
|
|
var deviceId = ms.ReadInt();
|
|
|
|
|
var switchState = ms.ReadByte();
|
|
|
|
@ -486,31 +488,31 @@ namespace IoT.Shared.DeviceServices.FBee
|
|
|
|
|
};
|
|
|
|
|
if (deviceName == "插座" || deviceName == "智能插座")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Socket/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Socket/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "一路开关")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Switch/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Switch/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "二路开关")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Switch2/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Switch2/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "三路开关")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Switch3/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Switch3/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "窗帘")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Curtain/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Curtain/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "调色灯")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/ColorLight/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/ColorLight/");
|
|
|
|
|
}
|
|
|
|
|
else if (deviceName == "红外转发器")
|
|
|
|
|
{
|
|
|
|
|
product.ApiJson = this.GetApiJson("/Ir/");
|
|
|
|
|
product.ApiJson = nodeService.GetApiJson("/Ir/");
|
|
|
|
|
}
|
|
|
|
|
OpenApiService.UpdateApi(product);
|
|
|
|
|
productRepo.Add(product);
|
|
|
|
|