Skip to content

Commit 0b0abbf

Browse files
committed
Use new InvalidCommand exception
1 parent 44c6baf commit 0b0abbf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ async def test_energy_scan(app):
734734
async def test_energy_scan_legacy_module(app):
735735
"""Test channel energy scan."""
736736
app._api._at_command = mock.AsyncMock(
737-
spec=XBee._at_command, side_effect=RuntimeError
737+
spec=XBee._at_command, side_effect=InvalidCommand
738738
)
739739
time_s = 3
740740
count = 3

zigpy_xbee/zigbee/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ async def energy_scan(
199199
for _ in range(count):
200200
try:
201201
results = await self._api._at_command("ED", bytes([duration_exp]))
202-
except RuntimeError:
202+
except InvalidCommand:
203203
LOGGER.warning("Coordinator does not support energy scanning")
204204
return {c: 0 for c in channels}
205205

0 commit comments

Comments
 (0)