1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 03:32:20 +01:00

Handle client disconnects

This commit is contained in:
kbx81
2025-09-10 17:57:28 -05:00
parent 0b58a12034
commit ea68b1a096

View File

@@ -20,6 +20,10 @@ void ZWaveProxy::loop() {
if (this->response_handler_()) {
return; // If a response was handled, exit early to avoid a CAN
}
if (this->api_connection_ != nullptr && !this->api_connection_->is_connection_setup()) {
ESP_LOGW(TAG, "Subscriber disconnected");
this->api_connection_ = nullptr; // Unsubscribe if disconnected
}
while (this->available()) {
uint8_t byte;