tzy
2021-03-29 8cd7b0fd1c53fc35a9817de31ab5d90f7dc7814b
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -699,46 +699,60 @@
                            case SPK.AirFreshJinmao:
                                //1   新风编号    1~200
                                //2   类型 第三方类型  0:金茂新风
                                //3   开关  0 - 关机,1 - 开机
                                byte switchValue = 0;
                                if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) == true
                                    && commandDictionary[FunctionAttributeKey.OnOff] == "on")
                                {
                                    switchValue = 1;
                                }
                                //4   运行模式    1 - 通风,2 - 加湿
                                byte airFreshMode = 1;
                                if (function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                                if (commandDictionary.ContainsKey(FunctionAttributeKey.Mode) == true
                                    && commandDictionary[FunctionAttributeKey.Mode] == "fan")
                                {
                                    airFreshMode = 2;
                                }
                                //5   节能舒适选择  1 - 舒适,2 - 节能
                                byte airFreshEnergy = 1;
                                 if(   function.GetAttrState(FunctionAttributeKey.Energy)=="true")
                                if (commandDictionary.ContainsKey(FunctionAttributeKey.Energy) == true
                                   && commandDictionary[FunctionAttributeKey.Energy] == "true")
                                {
                                    airFreshEnergy = 2;
                                }
                                //6   风速档位    0 - 自动,1 - 1档,2 - 2档,3 - 3档
                                byte airFreshFan = 0;
                                switch(function.GetAttrState(FunctionAttributeKey.FanSpeed))
                                if (commandDictionary.ContainsKey(FunctionAttributeKey.FanSpeed) == true)
                                {
                                    case "auto":
                                        airFreshFan = 0;
                                        break;
                                    case "level_1":
                                        airFreshFan = 1;
                                        break;
                                    case "level_2":
                                        airFreshFan = 2;
                                        break;
                                    case "level_3":
                                        airFreshFan = 3;
                                        break;
                                    switch (commandDictionary[FunctionAttributeKey.FanSpeed])
                                    {
                                        case "auto":
                                            airFreshFan = 0;
                                            break;
                                        case "level_1":
                                            airFreshFan = 1;
                                            break;
                                        case "level_2":
                                            airFreshFan = 2;
                                            break;
                                        case "level_3":
                                            airFreshFan = 3;
                                            break;
                                    }
                                }
                                //7   湿度设定 %
                                //8   室内温度值   ℃
                                //9   室内湿度值   ℃
                                //10  过滤网剩余 %
                                //11  过滤网使用超时 1 超时 0 无
                                ControlBytesSend(Command.FreshAirControl_JinMao, subnetId, deviceId, new byte[] {
                                    function.bus.LoopId,0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0 ,
                                    function.bus.LoopId,0, switchValue ,
                                    airFreshMode,airFreshEnergy,
                                    airFreshFan,
                                    Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Humidity)),
                                    Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Humidity)),
                                    0,0,0,0
                                    //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorTemp)),
                                    //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorHumidity)),