[whirlpool] support for 14 byte whirlpool IR receiver messages (#12774)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
Samuel Schultze
2026-01-05 13:45:32 -03:00
committed by GitHub
parent d107b37d3b
commit 086eb4b930

View File

@@ -163,6 +163,7 @@ bool WhirlpoolClimate::on_receive(remote_base::RemoteReceiveData data) {
}
uint8_t remote_state[WHIRLPOOL_STATE_LENGTH] = {0};
bool skip_footer = false;
// Read all bytes.
for (int i = 0; i < WHIRLPOOL_STATE_LENGTH; i++) {
// Read bit
@@ -170,6 +171,13 @@ bool WhirlpoolClimate::on_receive(remote_base::RemoteReceiveData data) {
if (!data.expect_item(WHIRLPOOL_BIT_MARK, WHIRLPOOL_GAP))
return false;
}
if (i == 14 && !data.is_valid()) {
// Remote control only sent 14 bytes, nothing more to read, not even the footer
ESP_LOGV(TAG, "Remote control only sent %d bytes", i);
skip_footer = true;
break;
}
for (int j = 0; j < 8; j++) {
if (data.expect_item(WHIRLPOOL_BIT_MARK, WHIRLPOOL_ONE_SPACE)) {
remote_state[i] |= 1 << j;
@@ -183,7 +191,7 @@ bool WhirlpoolClimate::on_receive(remote_base::RemoteReceiveData data) {
ESP_LOGVV(TAG, "Byte %d %02X", i, remote_state[i]);
}
// Validate footer
if (!data.expect_mark(WHIRLPOOL_BIT_MARK)) {
if (!data.expect_mark(WHIRLPOOL_BIT_MARK) && !skip_footer) {
ESP_LOGV(TAG, "Footer fail");
return false;
}
@@ -196,7 +204,7 @@ bool WhirlpoolClimate::on_receive(remote_base::RemoteReceiveData data) {
for (uint8_t i = 14; i < 20; i++)
checksum20 ^= remote_state[i];
if (checksum13 != remote_state[13] || checksum20 != remote_state[20]) {
if (checksum13 != remote_state[13] || (!skip_footer && checksum20 != remote_state[20])) {
ESP_LOGVV(TAG, "Checksum fail");
return false;
}