Disable uart_client_timeout if 100 or lower

This commit is contained in:
ElVit 2025-12-02 13:15:17 +01:00
parent db478a30fa
commit 94d156b30a
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;