| | |
| | | rgb.brightness = receiveBytes[1]; |
| | | rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; |
| | | } |
| | | rgb.redColor = receiveBytes[6]; |
| | | rgb.greenColor = receiveBytes[7]; |
| | | rgb.blueColor = receiveBytes[8]; |
| | | rgb.SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }); |
| | | |
| | | HomePage.UpdataFunctionStates(rgb); |
| | | RoomPage.UpdataStates(rgb); |
| | |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | | ac.curTempType = receiveBytes[1]; |
| | | ac.indoorTemp = receiveBytes[2]; |
| | | ac.trait_IndoorTemp.curValue = receiveBytes[2]; |
| | | ac.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off"; |
| | | ac.curModeIndex = receiveBytes[9]; |
| | | ac.curFanIndex = receiveBytes[10]; |
| | |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | | ac.indoorTemp = receiveBytes[1]; |
| | | ac.trait_IndoorTemp.curValue = receiveBytes[1]; |
| | | FunctionPage.UpdataStates(ac); |
| | | } |
| | | } |
| | |
| | | var mac = ByteToHex16(receiveBytes[5]) + ByteToHex16(receiveBytes[6]) + ByteToHex16(receiveBytes[7]) + ByteToHex16(receiveBytes[8]) + ByteToHex16(receiveBytes[9]) + ByteToHex16(receiveBytes[10]) + ByteToHex16(receiveBytes[11]) + ByteToHex16(receiveBytes[12]); |
| | | var Name = Encoding.GetEncoding("gb2312").GetString(receiveBytes, 13, 20).Trim('\0'); ; |
| | | MainPage.Log($"name : {Name} ; mac : {mac}"); |
| | | if (DB_ResidenceData.residenceData.residenceGatewayMAC == mac) |
| | | if (DB_ResidenceData.Instance.residenceGatewayMAC == mac) |
| | | { |
| | | DriverLayer.Control.Ins.GatewayOnline = true; |
| | | DriverLayer.Control.Ins.IsRemote = false; |
| | | Control.Ins.GatewayOnline = true; |
| | | Control.Ins.IsRemote = false; |
| | | DAL.Mqtt.MqttClient.DisConnectRemote();//断开mqtt |
| | | } |
| | | break; |