From f3f7bdc4e11a006b6305a48740b85a68b9d31be5 Mon Sep 17 00:00:00 2001
From: swoboda1337 <154711427+swoboda1337@users.noreply.github.com>
Date: Mon, 18 Mar 2024 02:35:06 -0400
Subject: [PATCH] Fix bug in `remote_base` conditional (#6281)

Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
---
 esphome/components/remote_base/remote_base.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/esphome/components/remote_base/remote_base.cpp b/esphome/components/remote_base/remote_base.cpp
index 095f95053f..f3e86aaab6 100644
--- a/esphome/components/remote_base/remote_base.cpp
+++ b/esphome/components/remote_base/remote_base.cpp
@@ -16,7 +16,7 @@ RemoteRMTChannel::RemoteRMTChannel(uint8_t mem_block_num) : mem_block_num_(mem_b
 }
 
 void RemoteRMTChannel::config_rmt(rmt_config_t &rmt) {
-  if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) >= RMT_CHANNEL_MAX) {
+  if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) > RMT_CHANNEL_MAX) {
     this->mem_block_num_ = int(RMT_CHANNEL_MAX) - int(this->channel_);
     ESP_LOGW(TAG, "Not enough RMT memory blocks available, reduced to %i blocks.", this->mem_block_num_);
   }