zigpy / bellows

A Python 3 project to implement EZSP for EmberZNet devices
GNU General Public License v3.0
182 stars 86 forks source link

Handle out of order and duplicate energy scan results #566

Closed puddly closed 1 year ago

puddly commented 1 year ago

Seems like scan results can sometimes interleave (https://github.com/home-assistant/core/issues/94733#issuecomment-1600585388). This PR increases the resilience of the energy scanning code to account for this unexpected corner case.

There is no associated debug log but I'm assuming this is what happens.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (178004a) 99.76% compared to head (4a7d59e) 99.76%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #566 +/- ## ======================================= Coverage 99.76% 99.76% ======================================= Files 62 62 Lines 4713 4713 ======================================= Hits 4702 4702 Misses 11 11 ``` | [Impacted Files](https://app.codecov.io/gh/zigpy/bellows/pull/566?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) | Coverage Δ | | |---|---|---| | [bellows/zigbee/application.py](https://app.codecov.io/gh/zigpy/bellows/pull/566?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy#diff-YmVsbG93cy96aWdiZWUvYXBwbGljYXRpb24ucHk=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.