| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送节能命令 |
| | | this.SendOtherComand(this.btnMode1, "energy", "true"); |
| | | this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "true"); |
| | | }); |
| | | |
| | | //舒适 |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送舒适命令 |
| | | this.SendOtherComand(this.btnMode1, "energy", "false"); |
| | | this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "false"); |
| | | }); |
| | | } |
| | | |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送通风命令 |
| | | this.SendOtherComand(this.btnMode2, "mode", "fan"); |
| | | this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "fan"); |
| | | }); |
| | | |
| | | //加湿 |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送加湿命令 |
| | | this.SendOtherComand(this.btnMode2, "mode", "humidification"); |
| | | this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "humidification"); |
| | | }); |
| | | } |
| | | |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, "fan", "level_1"); |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_1"); |
| | | }); |
| | | |
| | | //2档 |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, "fan", "level_2"); |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_2"); |
| | | }); |
| | | |
| | | //3档 |
| | |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, "fan", "level_3"); |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_3"); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(comadKey, comadValue); |
| | | Control.Ins.SendWriteCommand(this.device, dic, true); |
| | | //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | var dic = this.GetSendComandSample(); |
| | | dic[comadKey] = comadValue; |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | btnIcon.CanClick = true; |
| | |
| | | string statu = this.btnSwitch.IsSelected == true ? "off" : "on"; |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(FunctionAttributeKey.OnOff, statu); |
| | | Control.Ins.SendWriteCommand(this.device, dic, true); |
| | | //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | var dic = this.GetSendComandSample(); |
| | | dic[FunctionAttributeKey.OnOff] = statu; |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | this.btnSwitch.CanClick = true; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private Dictionary<string, string> GetSendComandSample() |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | //开关 |
| | | dic[FunctionAttributeKey.OnOff] = this.airFreshData.Open == true ? "on" : "off"; |
| | | //模式 |
| | | dic[FunctionAttributeKey.Mode] = this.airFreshData.Mode; |
| | | //节能 |
| | | dic[FunctionAttributeKey.Energy] = this.airFreshData.Energy; |
| | | //风速 |
| | | dic[FunctionAttributeKey.FanSpeed] = this.airFreshData.Fan ; |
| | | |
| | | return dic; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | var data = i_LocalDevice.attributes[i]; |
| | | //开关 |
| | | if (data.key == "on_off") { this.airFreshData.Open = data.state == "on"; } |
| | | if (data.key == FunctionAttributeKey.OnOff) { this.airFreshData.Open = data.state == "on"; } |
| | | //模式 |
| | | else if (data.key == "mode") { this.airFreshData.Mode = data.state; } |
| | | else if (data.key == FunctionAttributeKey.Mode) { this.airFreshData.Mode = data.state; } |
| | | //节能 |
| | | else if (data.key == "energy") { this.airFreshData.Energy = data.state; } |
| | | else if (data.key == FunctionAttributeKey.Energy) { this.airFreshData.Energy = data.state; } |
| | | //风速 |
| | | else if (data.key == "fan") { this.airFreshData.Fan = data.state; } |
| | | else if (data.key == FunctionAttributeKey.FanSpeed) { this.airFreshData.Fan = data.state; } |
| | | //湿度 |
| | | else if (data.key == "humidity") |
| | | else if (data.key == FunctionAttributeKey.Humidity) |
| | | { |
| | | if (data.state != string.Empty) |
| | | { |
| | |
| | | } |
| | | } |
| | | //室内温度 |
| | | else if (data.key == "indoor_temp") |
| | | else if (data.key == FunctionAttributeKey.IndoorTemp) |
| | | { |
| | | if (data.state != string.Empty) |
| | | { |
| | |
| | | } |
| | | } |
| | | //室内湿度 |
| | | else if (data.key == "indoor_humidity") |
| | | else if (data.key == FunctionAttributeKey.IndoorHumidity) |
| | | { |
| | | if (data.state != string.Empty) |
| | | { |
| | |
| | | } |
| | | } |
| | | //过滤网剩余量 |
| | | else if (data.key == "filter_remain") |
| | | else if (data.key == FunctionAttributeKey.FilterRemain) |
| | | { |
| | | if (data.state != string.Empty) |
| | | { |