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