Apply suggestions from code review

This commit is contained in:
Jesse Hills 2023-10-24 09:57:11 +13:00 committed by GitHub
parent 14099c12f1
commit 399301dcaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ void ZHLT01Climate::transmit_state() {
}
// -- Temperature
ir_message[9] |= (uint8_t)(this->target_temperature - 16.0f);
ir_message[9] |= (uint8_t) (this->target_temperature - 16.0f);
// Byte 11 : Remote control ID
ir_message[11] = 0xD5;
@ -164,8 +164,8 @@ bool ZHLT01Climate::on_receive(remote_base::RemoteReceiveData data) {
// Validate checksum
for (int i = 0; i < 12; i += 2) {
if (ir_message[i] != (uint8_t)(~ir_message[i + 1])) {
ESP_LOGV(TAG, "Byte %d checksum incorrect (%02X != %02X)", i, ir_message[i], (uint8_t)(~ir_message[i + 1]));
if (ir_message[i] != (uint8_t) (~ir_message[i + 1])) {
ESP_LOGV(TAG, "Byte %d checksum incorrect (%02X != %02X)", i, ir_message[i], (uint8_t) (~ir_message[i + 1]));
return false;
}
}