From 94d156b30ae3cd49b7ec002582dd44a016d987ef Mon Sep 17 00:00:00 2001 From: ElVit Date: Tue, 2 Dec 2025 13:15:17 +0100 Subject: [PATCH] Disable uart_client_timeout if 100 or lower --- components/panasonic_heatpump/README.md | 2 +- components/panasonic_heatpump/panasonic_heatpump.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/panasonic_heatpump/README.md b/components/panasonic_heatpump/README.md index cc6afc8..f76f863 100644 --- a/components/panasonic_heatpump/README.md +++ b/components/panasonic_heatpump/README.md @@ -115,7 +115,7 @@ climate: - **uart_id** (Optional, [ID](https://esphome.io/guides/configuration-types/#id)): Manually specify the UART ID of the Heatpump. Required if multiple UART buses are defined. - **uart_client_id** (*Optional*, [ID](https://esphome.io/guides/configuration-types/#id)): Manually specify the UART ID of an additonal UART client like the Panasonic CZ-TAW1. If this ID is not set then your ESP controller will send the polling request messages. - **log_uart_msg** (*Optional*, boolean): Shows the raw UART messages in the logs, if set to `true`. The messages will be written to the log level `INFO`. Defaults to false. -- **uart_client_timeout** (*Optional*, [Time](https://esphome.io/guides/configuration-types/#time)): Maximum idle time for the `uart_client_id` connection. If no request is sent from the UART client for this duration, the component will send a POLLING request to the heatpump. This will (hopefully) prevent the heatpump from becoming unresponsive. Defaults to `10s`. +- **uart_client_timeout** (*Optional*, [Time](https://esphome.io/guides/configuration-types/#time)): Maximum idle time for the `uart_client_id` connection. If no request is sent from the UART client for this duration, the component will send a POLLING request to the heatpump. This will (hopefully) prevent the heatpump from becoming unresponsive. This feature can also be disabled by setting this option to `100ms` or lower. Defaults to `10s`. ### Sensors diff --git a/components/panasonic_heatpump/panasonic_heatpump.cpp b/components/panasonic_heatpump/panasonic_heatpump.cpp index 01dfff7..d8ddba2 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.cpp +++ b/components/panasonic_heatpump/panasonic_heatpump.cpp @@ -26,7 +26,7 @@ void PanasonicHeatpumpComponent::update() { void PanasonicHeatpumpComponent::loop() { // Check if no request was sent for uart_client_timeout when uart_client is configured - if (this->uart_client_ != nullptr && this->uart_client_timeout_ > 0) { + if (this->uart_client_ != nullptr && this->uart_client_timeout_ > 100) { uint32_t current_time = millis(); if (current_time - this->last_request_time_ >= this->uart_client_timeout_) { this->next_request_ = RequestType::POLLING;