mirror of
https://github.com/esphome/esphome.git
synced 2026-09-20 19:48:39 +00:00
[e131] Fix IGMP rejoin after effect stop/start cycle
When leave_() decremented consumers to 0 without removing the entry, a subsequent join_() would find it, increment 0->1, and return early without rejoining the IGMP multicast group. Now join_() only skips the IGMP rejoin when consumers was already > 0.
This commit is contained in:
@@ -98,12 +98,13 @@ void E131Component::join_(int universe) {
|
||||
// store only latest received packet for the given universe
|
||||
auto *consumer = this->find_universe_(universe);
|
||||
if (consumer != nullptr) {
|
||||
consumer->consumers++;
|
||||
return; // we already joined before
|
||||
if (consumer->consumers++ > 0) {
|
||||
return; // we already joined before
|
||||
}
|
||||
} else {
|
||||
this->universe_consumers_.push_back({static_cast<uint16_t>(universe), 1});
|
||||
}
|
||||
|
||||
this->universe_consumers_.push_back({static_cast<uint16_t>(universe), 1});
|
||||
|
||||
if (this->join_igmp_groups_()) {
|
||||
ESP_LOGD(TAG, "Joined %d universe for E1.31.", universe);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user