diff --git a/projects/Infrastructure/wwwroot/css/site.css b/projects/Infrastructure/wwwroot/css/site.css index 8dce51d3..1a1218ea 100644 --- a/projects/Infrastructure/wwwroot/css/site.css +++ b/projects/Infrastructure/wwwroot/css/site.css @@ -48,7 +48,7 @@ border-radius: 5px; } /**/ -.fancybox img.thumbnail, td .fancybox img { +.fancybox img.thumbnail, td .fancybox img, .form-control .fancybox img { max-width: 30px; max-height: 30px; } diff --git a/projects/IoTCenter/Views/Home/Device.cshtml b/projects/IoTCenter/Views/Home/Device.cshtml index 3e32eb83..ac6a1e93 100644 --- a/projects/IoTCenter/Views/Home/Device.cshtml +++ b/projects/IoTCenter/Views/Home/Device.cshtml @@ -308,7 +308,7 @@ @@ -461,6 +461,20 @@ +
+
+
+
+

遥控器匹配

+
+ + + +
+
+
+
+
diff --git a/projects/IoTCenter/Views/Home/Node.cshtml b/projects/IoTCenter/Views/Home/Node.cshtml index 38622cc2..fb29bb11 100644 --- a/projects/IoTCenter/Views/Home/Node.cshtml +++ b/projects/IoTCenter/Views/Home/Node.cshtml @@ -391,7 +391,7 @@
diff --git a/projects/IoTCenter/appsettings.json b/projects/IoTCenter/appsettings.json index 6a922e7e..755c661a 100644 --- a/projects/IoTCenter/appsettings.json +++ b/projects/IoTCenter/appsettings.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-rc.104", + "version": "1.0.0-rc.105", "Logging": { "LogLevel": { "Default": "Warning", diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/device.html b/projects/IoTClient/Assets/StreamingAssets/wwwroot/device.html index 9bf6fb16..c7bc685f 100644 --- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/device.html +++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/device.html @@ -319,7 +319,7 @@ 空调 电视 - 图影仪 + 机顶盒 自定义 @@ -468,6 +468,16 @@
+
+
+ 遥控器匹配 +
+ + + +
+
+
自定义指令 diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/page.js b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/page.js index 07c6b656..a183fb60 100644 --- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/page.js +++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/page.js @@ -1,5 +1,5 @@ // -var version = '1.0.0-rc.101'; +var version = '1.0.0-rc.105'; var isDebug = isDebug || false; var useSignalR = useSignalR || false; var isApp = location.href.indexOf('http') !== 0; diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html index 329cae56..0d703f73 100644 --- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html +++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html @@ -342,7 +342,7 @@ 空调 电视 - 图影仪 + 机顶盒 自定义 diff --git a/projects/IoTClient/iotclient.apk.REMOVED.git-id b/projects/IoTClient/iotclient.apk.REMOVED.git-id index fd34c3b8..65b1d464 100644 --- a/projects/IoTClient/iotclient.apk.REMOVED.git-id +++ b/projects/IoTClient/iotclient.apk.REMOVED.git-id @@ -1 +1 @@ -25f978cc1dc22e8729d0400a5d8b6b66728855d5 \ No newline at end of file +db18615540b78f52eae016df7a574ae5a1b6f934 \ No newline at end of file diff --git a/projects/IoTNode/DeviceServices/FBee/Controllers/IrController.cs b/projects/IoTNode/DeviceServices/FBee/Controllers/IrController.cs index 1b32ff68..2c2dcf89 100644 --- a/projects/IoTNode/DeviceServices/FBee/Controllers/IrController.cs +++ b/projects/IoTNode/DeviceServices/FBee/Controllers/IrController.cs @@ -3,7 +3,6 @@ using IoTNode.DeviceServices.FBee; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; using System; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace IoTNode.Controllers @@ -47,5 +46,32 @@ namespace IoTNode.Controllers this._deviceService.UpdateButtons(number, buttons); }); } + + [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("空调匹配")] + public ApiResponse MathAir1([SwaggerParameter("设备编号")]string number) + { + return this.AsyncAction(() => + { + this._deviceService.IRMath(number, 1); + }); + } + + [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("电视匹配")] + public ApiResponse MathAir2([SwaggerParameter("设备编号")]string number) + { + return this.AsyncAction(() => + { + this._deviceService.IRMath(number, 2); + }); + } + + [HttpGet, Route("/[controller]/[action]"), SwaggerOperation("机顶盒匹配")] + public ApiResponse MathAir3([SwaggerParameter("设备编号")]string number) + { + return this.AsyncAction(() => + { + this._deviceService.IRMath(number, 3); + }); + } } } \ No newline at end of file diff --git a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs index 3c447cca..769bb88c 100644 --- a/projects/IoTNode/DeviceServices/FBee/FBeeService.cs +++ b/projects/IoTNode/DeviceServices/FBee/FBeeService.cs @@ -76,6 +76,24 @@ namespace IoTNode.DeviceServices.FBee } } + public void IRMath(string number, byte type) + { + using (var scope = _applicationServices.CreateScope()) + { + var deviceRepo = scope.ServiceProvider.GetService>(); + var device = deviceRepo.Table().Include(o => o.Data).FirstOrDefault(o => o.Number == number); + if (device != null) + { + var values = number.Split('-'); + var version = device.Data.FirstOrDefault(o => o.Key == Keys.Version)?.Value; + if (version != null) + { + this.XA70081(values[0], values[1], version, type); + } + } + } + } + public override void Execute() { var ips = NetworkInterface.GetAllNetworkInterfaces() @@ -1062,8 +1080,8 @@ namespace IoTNode.DeviceServices.FBee list.AddRange(new byte[] { 0x81, 0x00 }); list.Add(type); list[1] = (byte)(list.Count() - 3 + 2); - list.Add((byte)list.Skip(3).Take(12).Select(o => (int)o).Sum()); - list.Add(0x0a); + list.Add((byte)list.Skip(list.Count - 10).Take(10).Select(o => (int)o).Sum()); + //list.Add(0x1a); this.Write(sn, RequestType.xa7, ieee, list, 2); } @@ -1130,7 +1148,7 @@ namespace IoTNode.DeviceServices.FBee list.AddRange(BitConverter.GetBytes(code)); list[1] = (byte)(list.Count() - 3 + 2); list.Add((byte)list.Skip(5).Take(12).Select(o => (int)o).Sum()); - list.Add(0x0a); + //list.Add(0x1a); this.Write(sn, RequestType.xa7, ieee, list, 2); } diff --git a/projects/IoTNode/Startup.cs b/projects/IoTNode/Startup.cs index def3ac29..1ef73acd 100644 --- a/projects/IoTNode/Startup.cs +++ b/projects/IoTNode/Startup.cs @@ -31,11 +31,11 @@ namespace IoTNode services.AddTransient(); services.AddTransient(); services.AddSingleton(); - services.AddSingleton(); + //services.AddSingleton(); services.AddSingleton(); //services.AddSingleton(); services.AddHostedService(o => o.GetService()); - services.AddHostedService(o => o.GetService()); + //services.AddHostedService(o => o.GetService()); services.AddHostedService(o => o.GetService()); //services.AddHostedService(o => o.GetService()); base.ConfigureServices(services); diff --git a/projects/IoTNode/appsettings.json b/projects/IoTNode/appsettings.json index 0c2e8998..db31e1fa 100644 --- a/projects/IoTNode/appsettings.json +++ b/projects/IoTNode/appsettings.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-rc.104", + "version": "1.0.0-rc.105", "Logging": { "LogLevel": { "Default": "Warning",