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

[api] Add conditional compilation for Home Assistant service subscriptions (#9900)

This commit is contained in:
J. Nick Koston
2025-07-27 18:35:35 -10:00
committed by GitHub
parent 5029e248eb
commit 05f6d01cbe
15 changed files with 40 additions and 0 deletions

View File

@@ -369,11 +369,13 @@ void APIServer::set_password(const std::string &password) { this->password_ = pa
void APIServer::set_batch_delay(uint16_t batch_delay) { this->batch_delay_ = batch_delay; }
#ifdef USE_API_HOMEASSISTANT_SERVICES
void APIServer::send_homeassistant_service_call(const HomeassistantServiceResponse &call) {
for (auto &client : this->clients_) {
client->send_homeassistant_service_call(call);
}
}
#endif
#ifdef USE_API_HOMEASSISTANT_STATES
void APIServer::subscribe_home_assistant_state(std::string entity_id, optional<std::string> attribute,