| | |
| | | #region 功能数据 |
| | | public static FunctionList functionList = FunctionList.List; |
| | | |
| | | /// <summary> |
| | | /// 刷新住宅里面的搜索设备状态 |
| | | /// </summary> |
| | | public void RefreshResidenceFunctionStatus() |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | foreach (var function in functionList.GetAllDeviceFunctionList()) |
| | | { |
| | | Thread.Sleep(100); |
| | | switch (function.functionCategory) |
| | | { |
| | | case FunctionCategory.Light: |
| | | case FunctionCategory.Electrical: |
| | | case FunctionCategory.SwitchDevice: |
| | | case FunctionCategory.Curtain: |
| | | case FunctionCategory.Thermostat: |
| | | if (DB_ResidenceData.residenceData.GatewayType == 0) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Refresh Residence Function Status Error : {ex.Message}"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region oid列表 a协议转bus协议控制使用 |