| | |
| | | this.dicDeviceEpoint.Clear();
|
| | |
|
| | | //初始化设备枚举
|
| | | this.InitDeviceModelIdEnum(); |
| | | this.InitDeviceModelIdEnum();
|
| | | |
| | | //获取本地全部的设备文件 |
| | | List<string> listFile = this.GetAllDeviceFile(); |
| | |
| | | //如果当前是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename");
|
| | | return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
|
| | | }
|
| | |
|
| | | //获取编辑设备Mac名字的命令字符
|
| | |
| | | return null;
|
| | | }
|
| | | //加缓存
|
| | | Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename");
|
| | | Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
|
| | |
|
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RenameDeviceMacNameData>(result.ReceiptData);
|
| | | return new CommonDevice.RenameDeviceMacNameAllData { renameDeviceMacNameData = tempData };
|
| | |
| | | //如果当前是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename");
|
| | | return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
|
| | | }
|
| | | //获取编辑设备端点名字的命令字符
|
| | | var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName);
|
| | |
| | | return null;
|
| | | }
|
| | | //加缓存
|
| | | Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename");
|
| | | Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
|
| | |
|
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceRenameResponseData>(result.ReceiptData);
|
| | | return new CommonDevice.DeviceRenameAllData { deviceRenameData = tempData };
|
| | |
| | | return false;
|
| | | }
|
| | | //温湿度传感器没有定位功能
|
| | | if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatrueHumidity)
|
| | | if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatureHumidity)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | //面板的温度探头叫 面板名字+温度
|
| | | return deviceInfoType.DeviceDefultName + Language.StringByID(R.MyInternationalizationString.uTemperature);
|
| | | }
|
| | | else if (((TemperatureSensor)device).SensorDiv == 1)
|
| | | {
|
| | | //温度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
|
| | | }
|
| | | else if (((TemperatureSensor)device).SensorDiv == 2)
|
| | | {
|
| | | //湿度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.HumiditySensor);
|
| | | }
|
| | | }
|
| | | //其他情况,使用它的默认名称
|
| | | return deviceInfoType.DeviceDefultName + epointNo;
|
| | |
| | | /// <param name="device">设备对象</param>
|
| | | /// <param name="macName">Mac名字</param>
|
| | | /// <returns></returns>
|
| | | private void SetMacName(CommonDevice device, string macName)
|
| | | public void SetMacName(CommonDevice device, string macName)
|
| | | {
|
| | | device.DeviceName = macName;
|
| | | }
|
| | |
| | | /// <param name="device">设备对象</param>
|
| | | /// <param name="epointName">端点名字</param>
|
| | | /// <returns></returns>
|
| | | private void SetEpointName(CommonDevice device, string epointName)
|
| | | public void SetEpointName(CommonDevice device, string epointName)
|
| | | {
|
| | | device.DeviceEpointName = epointName;
|
| | | }
|
| | |
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A温湿度传感器;
|
| | | info.ConcreteText = this.dicDeviceModelIdEnum["A411"].A官方名字;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_TemperatureHumidity;
|
| | | }
|
| | | else if (temperatrue == true && humidity == false)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A温度传感器;
|
| | | info.ConcreteText = this.dicDeviceModelIdEnum["A412"].A官方名字;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue;
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_Temperature;
|
| | | }
|
| | | else if (temperatrue == false && humidity == true)
|
| | | {
|
| | |
| | | //门窗传感器
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_DoorWindow;
|
| | | info.ConcreteText = Language.StringByID(R.MyInternationalizationString.uSensorDoorWindow);
|
| | | }
|
| | | else if (iasZone.IasDeviceType == 541)
|
| | | {
|
| | | //球型移动传感器
|
| | | info.ConcreteType = DeviceConcreteType.Sensor_SphericalMotion;
|
| | | info.ConcreteText = this.dicDeviceModelIdEnum["MSPIRB-ZB.10"].A官方名字;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// <param name="device">设置源设备对象</param>
|
| | | public void SetDeviceInfoToMain(CommonDevice mainDevice, CommonDevice device)
|
| | | {
|
| | | if (string.IsNullOrEmpty(device.DeviceInfo.MacName) == false)
|
| | | {
|
| | | mainDevice.DeviceName = device.DeviceInfo.MacName;
|
| | | }
|
| | | if (string.IsNullOrEmpty(device.DeviceInfo.DeviceName) == false)
|
| | | {
|
| | | mainDevice.DeviceEpointName = device.DeviceInfo.DeviceName;
|
| | | }
|
| | | mainDevice.DeviceName = device.DeviceInfo.MacName;
|
| | | mainDevice.DeviceEpointName = device.DeviceInfo.DeviceName;
|
| | | mainDevice.CurrentGateWayId = device.CurrentGateWayId;
|
| | | mainDevice.ZigbeeType = device.DeviceInfo.ZigbeeType;
|
| | | mainDevice.IsOnline = device.DeviceInfo.IsOnline;
|
| | |
| | | /// </summary>
|
| | | Sensor_PMTwoPointFive = 1307,
|
| | | /// <summary>
|
| | | /// 温湿度传感器
|
| | | /// 温湿度传感器(这个单词拼错了,但是错了就错了呗,就这样了)
|
| | | /// </summary>
|
| | | Sensor_TemperatrueHumidity = 1308,
|
| | | Sensor_TemperatureHumidity = 1308,
|
| | |
|
| | | /// <summary>
|
| | | /// 运动传感器
|
| | |
| | | /// </summary>
|
| | | Sensor_Keyfob = -1307,
|
| | | /// <summary>
|
| | | /// 温度传感器
|
| | | /// 温度传感器(这个单词拼错了,但是错了就错了呗,就这样了)
|
| | | /// </summary>
|
| | | Sensor_Temperatrue = -1309,
|
| | | Sensor_Temperature = -1309,
|
| | | /// <summary>
|
| | | /// 湿度传感器
|
| | | /// </summary>
|