1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 23:22:21 +01:00

Add connection triggers to api (#5628)

This commit is contained in:
Jesse Hills
2023-10-30 15:02:49 +13:00
committed by GitHub
parent 0c46403eaf
commit 27b593ba85
5 changed files with 68 additions and 27 deletions

View File

@@ -111,6 +111,7 @@ void APIServer::loop() {
[](const std::unique_ptr<APIConnection> &conn) { return !conn->remove_; });
// print disconnection messages
for (auto it = new_end; it != this->clients_.end(); ++it) {
this->client_disconnected_trigger_->trigger((*it)->client_info_, (*it)->client_peername_);
ESP_LOGV(TAG, "Removing connection to %s", (*it)->client_info_.c_str());
}
// resize vector