| | |
| | | /// <param name="zbGateway">网关对象</param>
|
| | | /// <param name="deviceComingAction">接收到设备时的事件,设备对象为null时,代表接收完成</param>
|
| | | /// <returns>一直返回true</returns>
|
| | | public async Task<bool> SetDeviceToMemmoryByGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null)
|
| | | public bool SetDeviceToMemmoryByGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null)
|
| | | {
|
| | | //从网关获取全部的设备
|
| | | List<CommonDevice> listDevice = new List<CommonDevice>();
|
| | | List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
|
| | | List<CommonDevice> list = this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
|
| | |
|
| | | if (list == null)
|
| | | {
|
| | |
| | | this.GetDeviceIcon(device, ref unSelectFilePath, ref selectFilePath);
|
| | |
|
| | | btnIcon.UnSelectedImagePath = unSelectFilePath;
|
| | | btnIcon.SelectedImagePath = selectFilePath;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="deviceComingAction">接收到设备时的事件</param>
|
| | | /// <param name="mode">是否显示错误</param>
|
| | | /// <returns></returns> |
| | | public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) |
| | | public List<CommonDevice> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) |
| | | {
|
| | | if (ignoreTime == false)
|
| | | {
|
| | |
| | | try
|
| | | {
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 93 } };
|
| | | await realWay.Send("GetDeviceInfo", jObject.ToString());
|
| | | realWay.Send("GetDeviceInfo", jObject.ToString());
|
| | | }
|
| | | catch { canBreak = true; }
|
| | |
|
| | | while (canBreak == false && TimeOut < 60)
|
| | | {
|
| | | await Task.Delay(100);
|
| | | System.Threading.Thread.Sleep(100);
|
| | | TimeOut++;
|
| | | }
|
| | |
|
| | |
| | | this.dicDeviceModelIdEnum["H06C"] = "2800-2800";//智能门锁(H06C)
|
| | |
|
| | | //=========★★空调类(3600-3899)★★=========
|
| | | this.dicDeviceModelIdEnum["MAC/GW-ZB.431"] = "3600-3600";//zigbee空调网关模块
|
| | | this.dicDeviceModelIdEnum["MAC/GW-ZB.10"] = "3600-3600";//zigbee空调网关模块
|
| | |
|
| | | //=========★★中继器类(3900-3999)★★=========
|
| | | this.dicDeviceModelIdEnum["MSR-ZB.10"] = "3900-3900"; //zigbee中继器
|