Skip to content

Commit

Permalink
Simplify remote temperature calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
chwdt committed Feb 26, 2025
1 parent 98a7c60 commit c2f26a2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions components/cn105/hp_writings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,10 @@ void CN105Climate::sendRemoteTemperature() {
packet[5] = 0x07;
if (this->remoteTemperature_ > 0) {
packet[6] = 0x01;
this->remoteTemperature_ = this->remoteTemperature_ * 2;
this->remoteTemperature_ = round(this->remoteTemperature_);
this->remoteTemperature_ = this->remoteTemperature_ / 2;
float temp1 = 3 + ((this->remoteTemperature_ - 10) * 2);
packet[7] = (int)temp1;
float temp2 = (this->remoteTemperature_ * 2) + 128;
packet[8] = (int)temp2;
float temp = round(this->remoteTemperature_ * 2);
packet[7] = (byte)(temp - 16);
packet[8] = (byte)(temp + 128);
} else {
packet[6] = 0x00;
packet[8] = 0x80; //MHK1 send 80, even though it could be 00, since ControlByte is 00
}
// add the checksum
Expand Down

0 comments on commit c2f26a2

Please sign in to comment.