review comment

This commit is contained in:
J. Nick Koston 2025-07-25 11:27:01 -10:00
parent 3765058813
commit 91ec0f959e
No known key found for this signature in database

View File

@ -1830,9 +1830,7 @@ void APIConnection::process_state_subscriptions_() {
resp.set_entity_id(StringRef(it.entity_id)); resp.set_entity_id(StringRef(it.entity_id));
// Avoid string copy by directly using the optional's value if it exists // Avoid string copy by directly using the optional's value if it exists
if (it.attribute.has_value()) { resp.set_attribute(it.attribute.has_value() ? StringRef(it.attribute.value()) : StringRef(""));
resp.set_attribute(StringRef(it.attribute.value()));
}
resp.once = it.once; resp.once = it.once;
if (this->send_message(resp, SubscribeHomeAssistantStateResponse::MESSAGE_TYPE)) { if (this->send_message(resp, SubscribeHomeAssistantStateResponse::MESSAGE_TYPE)) {