mirror of
https://github.com/esphome/esphome.git
synced 2025-09-13 16:52:18 +01:00
preen
This commit is contained in:
@@ -207,11 +207,9 @@ void APIConnection::loop() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (state_subs_at_ != -1) {
|
if (state_subs_at_ >= 0) {
|
||||||
const auto &subs = this->parent_->get_state_subs();
|
const auto &subs = this->parent_->get_state_subs();
|
||||||
if (state_subs_at_ >= (int) subs.size()) {
|
if (state_subs_at_ < static_cast<int>(subs.size())) {
|
||||||
state_subs_at_ = -1;
|
|
||||||
} else {
|
|
||||||
auto &it = subs[state_subs_at_];
|
auto &it = subs[state_subs_at_];
|
||||||
SubscribeHomeAssistantStateResponse resp;
|
SubscribeHomeAssistantStateResponse resp;
|
||||||
resp.entity_id = it.entity_id;
|
resp.entity_id = it.entity_id;
|
||||||
@@ -220,6 +218,8 @@ void APIConnection::loop() {
|
|||||||
if (this->send_message(resp)) {
|
if (this->send_message(resp)) {
|
||||||
state_subs_at_++;
|
state_subs_at_++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
state_subs_at_ = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user