Skip to content

Commit

Permalink
Use new InvalidCommand exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Shulyaka committed Nov 17, 2023
1 parent 44c6baf commit 0b0abbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ async def test_energy_scan(app):
async def test_energy_scan_legacy_module(app):
"""Test channel energy scan."""
app._api._at_command = mock.AsyncMock(
spec=XBee._at_command, side_effect=RuntimeError
spec=XBee._at_command, side_effect=InvalidCommand
)
time_s = 3
count = 3
Expand Down
2 changes: 1 addition & 1 deletion zigpy_xbee/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def energy_scan(
for _ in range(count):
try:
results = await self._api._at_command("ED", bytes([duration_exp]))
except RuntimeError:
except InvalidCommand:
LOGGER.warning("Coordinator does not support energy scanning")
return {c: 0 for c in channels}

Expand Down

0 comments on commit 0b0abbf

Please sign in to comment.