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

[api] Add conditional compilation for Home Assistant state subscriptions (#9898)

This commit is contained in:
J. Nick Koston
2025-07-25 20:28:44 -10:00
committed by GitHub
parent da491f7090
commit a9d6ece752
14 changed files with 50 additions and 0 deletions

View File

@@ -871,6 +871,7 @@ void HomeassistantServiceResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_repeated_message(total_size, 1, this->variables);
ProtoSize::add_bool_field(total_size, 1, this->is_event);
}
#ifdef USE_API_HOMEASSISTANT_STATES
void SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->entity_id_ref_);
buffer.encode_string(2, this->attribute_ref_);
@@ -897,6 +898,7 @@ bool HomeAssistantStateResponse::decode_length(uint32_t field_id, ProtoLengthDel
}
return true;
}
#endif
bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
switch (field_id) {
case 1: