| | |
| | | get
|
| | | {
|
| | | var list = new List<CommonDevice>();
|
| | | foreach (var device in dicAllDevice.Values)
|
| | | foreach (var listMac in this.dicDeviceSort.Values)
|
| | | {
|
| | | list.Add(device);
|
| | | foreach (var strMac in listMac)
|
| | | {
|
| | | var listTemp = this.GetDevicesByMac(strMac);
|
| | | list.AddRange(listTemp);
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private Dictionary<string, HashSet<int>> dicDeviceEpoint = new Dictionary<string, HashSet<int>>();
|
| | | /// <summary>
|
| | | /// 设备Mac顺序
|
| | | /// </summary>
|
| | | private Dictionary<string, List<string>> dicDeviceSort = null;
|
| | | /// <summary>
|
| | | /// 设备文件的前缀名字
|
| | | /// </summary>
|
| | | public const string deviceFirstName = "Device_";
|
| | | /// <summary>
|
| | | /// 锁
|
| | | /// </summary>
|
| | | private object objLock = new object();
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | public void ReFreshByLocal() |
| | | { |
| | | this.dicAllDevice.Clear(); |
| | | this.dicDeviceEpoint.Clear(); |
| | | this.dicDeviceEpoint.Clear();
|
| | | |
| | | //初始化R文件里面设备默认名字的ID |
| | | this.InitDeviceDefultNameIDList(); |
| | |
| | | }
|
| | | } |
| | | //成员身份的时候,删除掉非法的网关文件 |
| | | this.DeleteGatewayFileByMemberModel(); |
| | | this.DeleteGatewayFileByMemberModel();
|
| | | //初始化设备顺序
|
| | | this.InitDeviceSort(); |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | return;
|
| | | }
|
| | | var listId = new HashSet<string>();
|
| | | foreach (var device in this.dicAllDevice.Values)
|
| | |
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | if (listId.Contains(device.CurrentGateWayId) == false)
|
| | | foreach (var device in this.dicAllDevice.Values)
|
| | | {
|
| | | listId.Add(device.CurrentGateWayId);
|
| | | if (listId.Contains(device.CurrentGateWayId) == false)
|
| | | {
|
| | | listId.Add(device.CurrentGateWayId);
|
| | | }
|
| | | }
|
| | | }
|
| | | var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway();
|
| | |
| | | {
|
| | | //从网关获取全部的设备
|
| | | List<CommonDevice> listDevice = new List<CommonDevice>();
|
| | | List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, deviceComingAction);
|
| | | List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
|
| | |
|
| | | if (list == null)
|
| | | {
|
| | |
| | | /// <param name="device">设备对象(这个东西有可能会被更改)</param>
|
| | | public void AddDeviceToMemory(ref CommonDevice device)
|
| | | {
|
| | | if (dicDeviceSort.ContainsKey(device.CurrentGateWayId) == false)
|
| | | {
|
| | | dicDeviceSort[device.CurrentGateWayId] = new List<string>();
|
| | | }
|
| | | if (dicDeviceSort[device.CurrentGateWayId].Contains(device.DeviceAddr) == false)
|
| | | {
|
| | | //保存顺序
|
| | | dicDeviceSort[device.CurrentGateWayId].Add(device.DeviceAddr);
|
| | | UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort);
|
| | | }
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | //如果它是升级的顶端端点,则不能让它加入到缓存,但是可以让他生成文件
|
| | | if (device is OTADevice)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | //交换属性
|
| | | var tempDevice = this.dicAllDevice[mainKeys];
|
| | | //将DeviceInfo的属性设置到主属性中
|
| | | this.SetDeviceInfoToMain(tempDevice, device);
|
| | | device = tempDevice;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.dicAllDevice[mainKeys] = device;
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | //交换属性
|
| | | var tempDevice = this.dicAllDevice[mainKeys];
|
| | | //将DeviceInfo的属性设置到主属性中
|
| | | this.SetDeviceInfoToMain(tempDevice, device);
|
| | | device = tempDevice;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.dicAllDevice[mainKeys] = device;
|
| | | }
|
| | | }
|
| | |
|
| | | //设备回路收集
|
| | |
| | | /// <param name="device"></param>
|
| | | private void BackupDeviceAfterReName(CommonDevice device)
|
| | | {
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == false)
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | return;
|
| | | }
|
| | | this.dicAllDevice[mainKeys] = device;
|
| | | device.ReSave();
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | this.dicAllDevice[mainKeys] = device;
|
| | | device.ReSave();
|
| | |
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | | }
|
| | | if (dicDeviceSort.ContainsKey(listdevice[0].CurrentGateWayId) == true &&
|
| | | dicDeviceSort[listdevice[0].CurrentGateWayId].Contains(info.DeviceAddr) == true)
|
| | | {
|
| | | //保存顺序
|
| | | dicDeviceSort[listdevice[0].CurrentGateWayId].Remove(info.DeviceAddr);
|
| | | UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort);
|
| | | }
|
| | |
|
| | | //删除文件
|
| | | foreach (CommonDevice device in listdevice)
|
| | |
| | | {
|
| | | //删除缓存
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | this.dicAllDevice.Remove(mainKeys);
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | this.dicAllDevice.Remove(mainKeys);
|
| | | }
|
| | | }
|
| | |
|
| | | //删除设备文件
|
| | |
| | | public List<CommonDevice> GetDeviceByGatewayID(string gwId)
|
| | | {
|
| | | List<CommonDevice> list = new List<CommonDevice>();
|
| | | //各网关的所有设备
|
| | | foreach (CommonDevice device in this.dicAllDevice.Values)
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | if (gwId == device.CurrentGateWayId)
|
| | | List<string> listSort = null;
|
| | | if (dicDeviceSort.ContainsKey(gwId) == false)
|
| | | {
|
| | | list.Add(device);
|
| | | dicDeviceSort[gwId] = new List<string>();
|
| | | }
|
| | | listSort = dicDeviceSort[gwId];
|
| | |
|
| | | //各网关的所有设备
|
| | | foreach (CommonDevice device in this.dicAllDevice.Values)
|
| | | {
|
| | | if (gwId == device.CurrentGateWayId)
|
| | | {
|
| | | if (listSort.Contains(device.DeviceAddr) == false)
|
| | | {
|
| | | listSort.Add(device.DeviceAddr);
|
| | | }
|
| | | }
|
| | | }
|
| | | //排序
|
| | | foreach (var strMac in listSort)
|
| | | {
|
| | | var listTemp = this.GetDevicesByMac(strMac);
|
| | | list.AddRange(listTemp);
|
| | | }
|
| | | //保存顺序
|
| | | UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort);
|
| | | }
|
| | |
|
| | | return list;
|
| | |
| | | /// <returns></returns>
|
| | | public CommonDevice GetDevice(string mainKeys)
|
| | | {
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | lock (dicAllDevice)
|
| | | {
|
| | | return this.dicAllDevice[mainKeys];
|
| | | if (this.dicAllDevice.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | return this.dicAllDevice[mainKeys];
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | {
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId9;
|
| | | info.BeloneType = DeviceBeloneType.A彩灯;
|
| | | info.ConcreteType = DeviceConcreteType.ColorDimmableLight;
|
| | | info.ConcreteType = DeviceConcreteType.ColorLight;
|
| | | }
|
| | | //8空调
|
| | | else if (dicType.ContainsKey(DeviceType.Thermostat) == true)
|
| | |
| | | #region ■ 设备排序___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化设备顺序
|
| | | /// </summary>
|
| | | private void InitDeviceSort()
|
| | | {
|
| | | //读取设备顺序
|
| | | this.dicDeviceSort = new Dictionary<string, List<string>>();
|
| | | string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile);
|
| | | var strData = UserCenterLogic.LoadFileContent(fullName);
|
| | | if (strData != null)
|
| | | {
|
| | | this.dicDeviceSort = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(strData);
|
| | | }
|
| | | foreach (var device in dicAllDevice.Values)
|
| | | {
|
| | | if (dicDeviceSort.ContainsKey(device.CurrentGateWayId) == false)
|
| | | {
|
| | | dicDeviceSort[device.CurrentGateWayId] = new List<string>();
|
| | | }
|
| | | if (dicDeviceSort[device.CurrentGateWayId].Contains(device.DeviceAddr) == false)
|
| | | {
|
| | | //新添加的设备
|
| | | dicDeviceSort[device.CurrentGateWayId].Add(device.DeviceAddr);
|
| | | }
|
| | | }
|
| | | foreach (var keys in dicDeviceSort.Keys)
|
| | | {
|
| | | var list = dicDeviceSort[keys];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (this.dicDeviceEpoint.ContainsKey(list[i]) == false)
|
| | | {
|
| | | //这个东西莫名的不见了?和设备列表匹配不上?
|
| | | list.RemoveAt(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //保存顺序
|
| | | UserCenterLogic.SaveFileContent(fullName, dicDeviceEpoint);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设备排序
|
| | | /// </summary>
|
| | | /// <param name="listDevice">设备对象</param>
|
| | | /// <param name="listDevice">需要排序的设备列表</param>
|
| | | /// <returns></returns>
|
| | | public List<CommonDevice> SortDeviceList(List<CommonDevice> listDevice)
|
| | | public List<CommonDevice> SortDevice(List<CommonDevice> listDevice)
|
| | | {
|
| | | List<CommonDevice> listSort = new List<CommonDevice>();
|
| | | var list = this.SortDeviceListByRule(listDevice);
|
| | | listSort.AddRange(list);
|
| | |
|
| | | return listSort;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// |
| | | /// </summary>
|
| | | /// <param name="listDevice">设备对象</param>
|
| | | /// <returns></returns>
|
| | | private List<CommonDevice> SortDeviceListByRule(List<CommonDevice> listDevice)
|
| | | {
|
| | | //设备排序的规则(Keys:设备类型(DeviceType) value:存放设备的容器)
|
| | | var dic = this.GetDeviceSortRule();
|
| | | foreach (CommonDevice device in listDevice)
|
| | | var dic = new Dictionary<string, CommonDevice>();
|
| | | for (int i = 0; i < listDevice.Count; i++)
|
| | | {
|
| | | if (device is IASZone)
|
| | | dic[(this.GetDeviceMainKeys(listDevice[i]))] = listDevice[i];
|
| | | }
|
| | | var list = new List<CommonDevice>();
|
| | | foreach (var listSort in this.dicDeviceSort.Values)
|
| | | {
|
| | | for (int i = 0; i < listSort.Count; i++)
|
| | | {
|
| | | //传感器有很多种
|
| | | var strType = ((IASZone)device).DeviceInfo.DeviceType.ToString();
|
| | | if (dic.ContainsKey(strType) == false || dic[strType] == null)
|
| | | if (dic.ContainsKey(listSort[i]) == true)
|
| | | {
|
| | | dic[strType] = new List<CommonDevice>();
|
| | | list.Add(dic[listSort[i]]);
|
| | | }
|
| | | dic[strType].Add(device);
|
| | | continue;
|
| | | }
|
| | | string checkKeys = device.Type.ToString();
|
| | | if (dic.ContainsKey(checkKeys) == false || dic[checkKeys] == null)
|
| | | {
|
| | | dic[checkKeys] = new List<CommonDevice>();
|
| | | }
|
| | | dic[checkKeys].Add(device);
|
| | | }
|
| | |
|
| | | List<CommonDevice> lstSort = new List<CommonDevice>();
|
| | | foreach (var list in dic.Values)
|
| | | {
|
| | | if (list != null && list.Count > 0)
|
| | | {
|
| | | lstSort.AddRange(list);
|
| | | }
|
| | | }
|
| | | return lstSort;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取设备排序的规则(Keys:设备类型(DeviceType) value:存放设备的容器)
|
| | | /// </summary>
|
| | | /// <returns></returns> |
| | | private Dictionary<string, List<CommonDevice>> GetDeviceSortRule()
|
| | | {
|
| | | var dic = new Dictionary<string, List<CommonDevice>>();
|
| | | //控制面板
|
| | | dic[DeviceType.OnOffSwitch.ToString()] = null;
|
| | | //卷帘
|
| | | dic[DeviceType.WindowCoveringDevice.ToString()] = null;
|
| | | //调光灯
|
| | | dic[DeviceType.ColorDimmableLight.ToString()] = null;
|
| | | //继电器
|
| | | dic[DeviceType.OnOffOutput.ToString()] = null;
|
| | | //空气开关
|
| | | dic[DeviceType.AirSwitch.ToString()] = null;
|
| | | //门窗磁传感器
|
| | | dic["21"] = null;
|
| | | dic["22"] = null;
|
| | | //水浸传感器
|
| | | dic["42"] = null;
|
| | | //烟雾传感器
|
| | | dic["40"] = null;
|
| | | //紧急按钮
|
| | | dic["44"] = null;
|
| | | //燃气传感器
|
| | | dic["43"] = null;
|
| | | //运动传感器
|
| | | dic["13"] = null;
|
| | | //钥匙扣
|
| | | dic["277"] = null;
|
| | |
|
| | | return dic;
|
| | | return list;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | #region ■ 获取设备列表的接口_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 从网关重新获取设备列表(★★★★★★★接收到设备时的事件,设备对象为null时,代表接收完成★★★★★★★)
|
| | | /// 从网关重新获取设备列表(★★★★★★★接收到设备时的事件★★★★★★★)
|
| | | /// </summary>
|
| | | /// <param name="zbGateway">网关对象</param>
|
| | | /// <param name="deviceComingAction">接收到设备时的事件,设备对象为null时,代表接收完成</param>
|
| | | /// <param name="ignoreTime">是否无视时间,true:每次调用都去网关获取,false:3分钟内返回的是本地的设备</param>
|
| | | /// <param name="deviceComingAction">接收到设备时的事件</param>
|
| | | /// <param name="mode">是否显示错误</param>
|
| | | /// <returns></returns> |
| | | public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) |
| | | public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) |
| | | {
|
| | | if (ignoreTime == false)
|
| | | {
|
| | | if ((DateTime.Now - zbGateway.LastDateTime).TotalMilliseconds < 3 * 60 * 1000)
|
| | | {
|
| | | //不无视时间,返回本地设备列表
|
| | | var listTemp = this.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(zbGateway));
|
| | | if (deviceComingAction != null)
|
| | | {
|
| | | for (int i = 0; i < listTemp.Count; i++)
|
| | | {
|
| | | try
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction.Invoke(listTemp[i]);
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | | }
|
| | | }
|
| | | deviceComingAction = null;
|
| | | return listTemp;
|
| | | }
|
| | | }
|
| | | zbGateway.LastDateTime = DateTime.Now;
|
| | |
|
| | | //如果切换到了别的界面,则不显示错误信息
|
| | | string nowFormId = UserCenterResourse.NowActionFormID;
|
| | |
|
| | |
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway);
|
| | | if (device != null)
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction?.Invoke(device);
|
| | | try
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction?.Invoke(device);
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | listDevice.Add(device);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //回调函数(接收完成)
|
| | | deviceComingAction?.Invoke(null); |
| | | //回调函数(接收完成) |
| | | deviceComingAction = null; |
| | | |
| | | return listDevice; |
| | |
| | | mainDevice.DriveCode = device.DeviceInfo.DriveCode;
|
| | | mainDevice.IasDeviceType = device.DeviceInfo.DeviceType;
|
| | | mainDevice.Profile = device.DeviceInfo.Profile;
|
| | | mainDevice.Type = device.Type;
|
| | |
|
| | | //固件版本
|
| | | mainDevice.ImgVersion = device.DeviceInfo.ImgVersion;
|
| | |
| | | mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList);
|
| | | mainDevice.AttributeStatus.Clear();
|
| | | mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus);
|
| | | |
| | |
|
| | | //如果是温度传感器
|
| | | if (mainDevice is TemperatureSensor)
|
| | | if (mainDevice.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | //输出族 1026:温度传感器 1029:湿度传感器
|
| | | foreach (var data in mainDevice.OutClusterList)
|
| | |
| | | {
|
| | | ((TemperatureSensor)mainDevice).SensorDiv = 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | //如果是调光器
|
| | | else if (mainDevice.Type == DeviceType.DimmableLight )
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/Light.png";
|
| | | }
|
| | | }
|
| | | //如果是彩灯的话
|
| | | else if ( mainDevice.Type == DeviceType.ColorDimmableLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/ColorLight.png";
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | #endregion
|
| | | }
|
| | |
|
| | | #region ■ 自定义设备类型_________________________
|
| | |
|
| | | /// <summary>
|
| | | /// <para>仅限底层使用:设备的具体【设备类型】,自定义与模块id关联的枚举(值为LocalDevice里面dicDeviceModelIdEnum所指定的值)</para>
|
| | | /// <para>变量名可以作为【设备类型】图片,这个值是瞎写的,没什么特殊意义</para>
|
| | | /// </summary>
|
| | | public enum DeviceConcreteType
|
| | | {
|
| | | //定义规则:【设备类型】图片名字=LocalDevice里面dicDeviceModelIdEnum所指定的值
|
| | |
|
| | | /// <summary>
|
| | | /// 未知设备
|
| | | /// </summary>
|
| | | UnKownDevice = -1,
|
| | |
|
| | | //=========★★窗帘类(100-199)★★=========
|
| | | /// <summary>
|
| | | /// 窗帘
|
| | | /// </summary>
|
| | | Curtain = -100,
|
| | | /// <summary>
|
| | | /// 智能开合帘电机 镜像id:100
|
| | | /// </summary>
|
| | | Curtain_AutoOpen = 100,
|
| | | /// <summary>
|
| | | /// 智能管状电机 镜像id:101
|
| | | /// </summary>
|
| | | Curtain_Siphonate = 101,
|
| | |
|
| | | //=========★★按键面板类(200-1199)★★=========
|
| | | /// <summary>
|
| | | /// 按键面板
|
| | | /// </summary>
|
| | | ButtonPanel = -200,
|
| | | /// <summary>
|
| | | /// 4按键多功能触摸面板(带4路继电器底座) 镜像id:200
|
| | | /// </summary>
|
| | | ButtonPanel_Four = 200,
|
| | | /// <summary>
|
| | | /// 3按键多功能触摸面板(带3路继电器底座) 镜像id:201
|
| | | /// </summary>
|
| | | ButtonPanel_Three = 201,
|
| | | /// <summary>
|
| | | /// 2按键多功能触摸面板(带2路继电器底座) 镜像id:202
|
| | | /// </summary>
|
| | | ButtonPanel_Two = 202,
|
| | | /// <summary>
|
| | | /// 12按键多功能触摸面板(带1路继电器底座) 镜像id:203
|
| | | /// </summary>
|
| | | ButtonPanel_Twelve = 203,
|
| | | /// <summary>
|
| | | /// 4按键多功能触摸面板(只带电源底座) 镜像id:210
|
| | | /// </summary>
|
| | | ButtonPanel_FourNotPower = 210,
|
| | |
|
| | | //=========★★PIR传感器类(1200-1299)★★=========
|
| | | /// <summary>
|
| | | /// 传感器
|
| | | /// </summary>
|
| | | Sensor = -1200,
|
| | | /// <summary>
|
| | | /// pir传感器220 镜像id:1200
|
| | | /// </summary>
|
| | | Sensor_Pir = 1200,
|
| | |
|
| | | //=========★★安防类传感器类(1300-2299)★★=========
|
| | | /// <summary>
|
| | | /// 燃气传感器
|
| | | /// </summary>
|
| | | Sensor_CarbonMonoxide = 1300,
|
| | | /// <summary>
|
| | | /// 门窗传感器
|
| | | /// </summary>
|
| | | Sensor_DoorWindow = 1301,
|
| | | /// <summary>
|
| | | /// 烟雾传感器
|
| | | /// </summary>
|
| | | Sensor_Fire = 1302,
|
| | | /// <summary>
|
| | | /// 红外传感器
|
| | | /// </summary>
|
| | | Sensor_Infrared = 1303,
|
| | | /// <summary>
|
| | | /// 水侵传感器
|
| | | /// </summary>
|
| | | Sensor_Water = 1304,
|
| | | /// <summary>
|
| | | /// 紧急按钮
|
| | | /// </summary>
|
| | | Sensor_EmergencyButton = 1305,
|
| | | /// <summary>
|
| | | /// 运动传感器
|
| | | /// </summary>
|
| | | Sensor_Motion = -1306,
|
| | | /// <summary>
|
| | | /// 钥匙扣
|
| | | /// </summary>
|
| | | Sensor_Keyfob = -1307,
|
| | | /// <summary>
|
| | | /// 温湿度传感器
|
| | | /// </summary>
|
| | | Sensor_TemperatrueHumidity = -1308,
|
| | | /// <summary>
|
| | | /// 温度传感器
|
| | | /// </summary>
|
| | | Sensor_Temperatrue = -1309,
|
| | | /// <summary>
|
| | | /// 湿度传感器
|
| | | /// </summary>
|
| | | Sensor_Humidity = -1310,
|
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | /// <summary>
|
| | | /// 继电器
|
| | | /// </summary>
|
| | | Relay = -2300,
|
| | | /// <summary>
|
| | | /// 三路继电器 镜像id:2300
|
| | | /// </summary>
|
| | | Relay_ThreeLoad = 2300,
|
| | |
|
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | /// <summary>
|
| | | /// 调光器
|
| | | /// </summary>
|
| | | DimmableLight = -2500,
|
| | | /// <summary>
|
| | | /// 1路调光器小模块
|
| | | /// </summary>
|
| | | DimmableLight_OneLoad = 2500,
|
| | |
|
| | | //=========★★智能门锁类(2800-????)★★=========
|
| | | /// <summary>
|
| | | /// 智能门锁
|
| | | /// </summary>
|
| | | IntelligentLocks = -2800,
|
| | | /// <summary>
|
| | | /// H06C
|
| | | /// </summary>
|
| | | IntelligentLocks_H06C = 2800,
|
| | |
|
| | | //=========★★彩灯类(????-????)★★=========
|
| | | /// <summary>
|
| | | /// 彩灯
|
| | | /// </summary>
|
| | | ColorLight = -10,
|
| | |
|
| | | //=========★★空调(3600-3899)★★=========
|
| | | /// <summary>
|
| | | /// 空调
|
| | | /// </summary>
|
| | | AirConditioner = -3600,
|
| | | /// <summary>
|
| | | /// zigbee空调网关模块
|
| | | /// </summary>
|
| | | AirConditioner_ZbGateway = 3600,
|
| | |
|
| | | //=========★★中继器(3900-3999)★★=========
|
| | | /// <summary>
|
| | | /// 中继器
|
| | | /// </summary>
|
| | | Repeater = -3900,
|
| | | /// <summary>
|
| | | /// zigbee中继器 镜像id:3900
|
| | | /// </summary>
|
| | | Repeater_Zigbee = 3900,
|
| | |
|
| | | //=========★★空气开关类(4100-????)★★=========
|
| | | /// <summary>
|
| | | /// 智能空气开关
|
| | | /// </summary>
|
| | | AirSwitch = -4100,
|
| | | /// <summary>
|
| | | /// 微断云控制器 镜像id:4100
|
| | | /// </summary>
|
| | | AirSwitch_CloudContr = 4100,
|
| | |
|
| | | //=========★★转换器类(4200-4699)★★=========
|
| | | /// <summary>
|
| | | /// 转换器
|
| | | /// </summary>
|
| | | Converter = -4200,
|
| | | /// <summary>
|
| | | /// zigbee转485协议转换器
|
| | | /// </summary>
|
| | | Converter_Zb485 = 4200,
|
| | | /// <summary>
|
| | | /// zigbee转buspro协议转换器
|
| | | /// </summary>
|
| | | Converter_ZbBuspro = 4201,
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// <para>仅限底层使用:设备所属的【设备种类】,自定义与模块id关联的枚举(值为LocalDevice里面dicDeviceModelIdEnum所指定的值)</para>
|
| | | /// <para>这个值是瞎写的,没什么特殊意义</para>
|
| | | /// </summary>
|
| | | public enum DeviceBeloneType
|
| | | {
|
| | | /// <summary>
|
| | | /// 未知设备
|
| | | /// </summary>
|
| | | A未知设备 = 0,
|
| | | /// <summary>
|
| | | /// 窗帘(100-199)
|
| | | /// </summary>
|
| | | A窗帘 = 100,
|
| | | /// <summary>
|
| | | /// 按键面板(200-1199)
|
| | | /// </summary>
|
| | | A按键面板 = 200,
|
| | | /// <summary>
|
| | | /// 传感器(1200-2299)
|
| | | /// </summary>
|
| | | A传感器 = 1200,
|
| | | /// <summary>
|
| | | /// 继电器(2300-2499)
|
| | | /// </summary>
|
| | | A继电器 = 2300,
|
| | | /// <summary>
|
| | | /// 调光器(2500-2799)
|
| | | /// </summary>
|
| | | A调光器 = 2500,
|
| | | /// <summary>
|
| | | /// 智能门锁(2800-????)
|
| | | /// </summary>
|
| | | A智能门锁 = 2800,
|
| | | /// <summary>
|
| | | /// 空调(3600-3899)
|
| | | /// </summary>
|
| | | A空调 = 3600,
|
| | | /// <summary>
|
| | | /// 中继器(3900-3999)
|
| | | /// </summary>
|
| | | A中继器 = 3900,
|
| | | /// <summary>
|
| | | /// 空气开关(4100-4199)
|
| | | /// </summary>
|
| | | A空气开关 = 4100,
|
| | | /// <summary>
|
| | | /// 转换器(4200-4699)
|
| | | /// </summary>
|
| | | A转换器 = 4200,
|
| | | /// <summary>
|
| | | /// 彩灯
|
| | | /// </summary>
|
| | | A彩灯 = 9,
|
| | | /// <summary>
|
| | | /// 温湿度传感器
|
| | | /// </summary>
|
| | | A温湿度传感器 = 10,
|
| | | /// <summary>
|
| | | /// 温度传感器
|
| | | /// </summary>
|
| | | A温度传感器 = 11,
|
| | | /// <summary>
|
| | | /// 湿度传感器
|
| | | /// </summary>
|
| | | A湿度传感器 = 12
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|