黄学彪
2020-09-18 c7df85937f73fb347ee0b19e9c052d2d00a6df6c
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
@@ -118,7 +118,8 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelColorInfo(device, keyNum);
                //这里特殊,这里是按回路分的
                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyNum);
            }
            //发送数据 keyNum转为16进制 范围:01~10
            var passData = "0504040101" + Convert.ToString((int)keyNum, 16).ToUpper().PadLeft(2, '0');
@@ -215,7 +216,8 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device, keyColorData, keyNumStatus, null);
                //这个也是特殊,按回路来分
                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, null);
            }
            //获取配置按键指示灯颜色的命令字符
            var sendData = this.GetPanelColorCommandText(device.DeviceAddr, keyColorData, keyNumStatus);
@@ -230,7 +232,7 @@
            tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
            //添加缓存
            TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device, keyColorData, keyNumStatus, result.JsonData[0]);
            TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device.DeviceAddr, device.DeviceEpoint, keyColorData, keyNumStatus, result.JsonData[0]);
            return new CommonDevice.ResponseAllData { responseData = tempD };
        }
@@ -390,7 +392,7 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceLightSettion(device);
                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceLightSettion(device.DeviceAddr, 200);
            }
            //获取发送的命令字符
            var passData = "050604010101";
@@ -426,7 +428,7 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, null);
                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, null);
            }
            //获取修改面板的亮度调节的命令字符
            var sendData = this.GetPanelLevelCommadText(device.DeviceAddr, directionsLevel, backlightLevel);
@@ -460,7 +462,7 @@
            }
            //修改缓存
            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, result.JsonData[0]);
            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device.DeviceAddr, 200, directionsLevel, backlightLevel, result.JsonData[0]);
            return true;
        }
@@ -657,7 +659,7 @@
            //如果当前住宅是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceEnergyConservationMode(device);
                return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceEnergyConservationMode(device.DeviceAddr, 200);
            }
            //发送命令
            string passData = "050804010101";
@@ -723,7 +725,7 @@
            //如果当前是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, null);
                return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, null);
            }
            //获取设置设备的节能模式的命令字符
            var sendData = this.GetDeviceEnergyConservationModeCommandText(device.DeviceAddr, modeEnable, modeTime, level);
@@ -753,7 +755,7 @@
            }
            //修改缓存
            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, result.JsonData[0]);
            TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device.DeviceAddr, 200, modeEnable, modeTime, level, result.JsonData[0]);
            return true;
        }
@@ -1094,7 +1096,7 @@
            //如果是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelVibrationInfo(device);
                return TemplateData.TemplateDeviceDataLogic.Current.GetPanelVibrationInfo(device.DeviceAddr, 200);
            }
            //发送数据
            var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
@@ -1129,7 +1131,7 @@
            //如果是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device, datainfo, null);
                return TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, null);
            }
            //获取编辑面板震动功能的命令字符
            var sendData = this.GetPanelVibrationCommandText(device.DeviceAddr, datainfo);
@@ -1143,7 +1145,7 @@
                return false;
            }
            //添加缓存
            TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device, datainfo, result.JsonData[0]);
            TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device.DeviceAddr, 200, datainfo, result.JsonData[0]);
            return true;
        }