zigpy / zigpy-xbee

A library which communicates with XBee radios for zigpy
GNU General Public License v3.0
22 stars 18 forks source link

Don't fail on energy scan with legacy modules #166

Closed Shulyaka closed 10 months ago

Shulyaka commented 11 months ago

Fixes https://github.com/home-assistant/core/issues/103208

If we receive the RuntimeError exeption on ED command, return zero energy scanning results instead of raising the exception.

puddly commented 11 months ago

Thanks! It would be nice to use a more specific exception than RuntimeError to deal with unknown commands.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (626bce6) 100.00% compared to head (0b0abbf) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #166 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 7 7 Lines 780 784 +4 ========================================= + Hits 780 784 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Shulyaka commented 11 months ago

It would be nice to use a more specific exception than RuntimeError to deal with unknown commands.

While checking your suggestion, I have noticed that the actual error is slightly different, it's not an unknown command but invalid parameter. I will need some more time to double check the solution.

Shulyaka commented 11 months ago

Superseded by #168. The command is supported. This PR is not needed.

Shulyaka commented 11 months ago

Reopen for https://github.com/home-assistant/core/issues/103208#issuecomment-1793871414

Shulyaka commented 11 months ago

Once #169 is merged, I will update this PR to use a more specific exception.

Shulyaka commented 10 months ago

Done, updated and rebased.