本帖最后由 FrankLv 于 2020-3-2 01:56 编辑
看了帖子,分析了数据,我想这个应该是通用的,NND椰奶也搞这种,我也是服了
将nr中的
if (data.fan_speed_idx === xxxx) {
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx === xxxx) {
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx === xxxx) {
data.fan_speed_idx = "high";
}
替换成
if (data.bh_mode === "warmwind"){
if(data.fan_speed_idx.toString().slice(-1) === "0"){
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx.toString().slice(-1) === "1"){
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx.toString().slice(-1) === "2"){
data.fan_speed_idx = "high";
}
} else if (data.bh_mode === "venting"){
if(data.fan_speed_idx.toString().slice(-2,-1) === "0"){
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx.toString().slice(-2,-1) === "1"){
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx.toString().slice(-2,-1) === "2"){
data.fan_speed_idx = "high";
} else if (data.fan_speed_idx.toString().slice(-2,-1) === "9"){
data.fan_speed_idx = "tophigh";
}
} else if (data.bh_mode === "drying"){
if(data.fan_speed_idx.toString().slice(-3,-2) === "0" || data.fan_speed_idx.toString().slice(-3,-2) === "" ){
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx.toString().slice(-3,-2) === '1'){
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx.toString().slice(-3,-2) === '2'){
data.fan_speed_idx = "high";
}
} else if (data.bh_mode === "coolwind"){
if(data.fan_speed_idx.toString().slice(-4,-3) === "0" || data.fan_speed_idx.toString().slice(-4,-3) === "" ){
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx.toString().slice(-4,-3) === '1'){
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx.toString().slice(-4,-3) === '2'){
data.fan_speed_idx = "high";
}
} else if (data.bh_mode === "drying_cloth"){
if(data.fan_speed_idx.toString().slice(-5,-4) === "0" || data.fan_speed_idx.toString().slice(-5,-4) === "" ){
data.fan_speed_idx = "low";
} else if (data.fan_speed_idx.toString().slice(-5,-4) === '1'){
data.fan_speed_idx = "medium";
} else if (data.fan_speed_idx.toString().slice(-5,-4) === '2'){
data.fan_speed_idx = "high";
}
}
|