Skip to content

Commit

Permalink
Fix energy scan duraton (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shulyaka authored Nov 5, 2023
1 parent b8564a8 commit 367fed5
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 @@ -709,7 +709,7 @@ async def test_energy_scan(app):
energy = await app.energy_scan(
channels=list(range(11, 27)), duration_exp=time_s, count=count
)
assert app._api._at_command.mock_calls == [mock.call("ED", time_s)] * count
assert app._api._at_command.mock_calls == [mock.call("ED", bytes([time_s]))] * count
assert {k: round(v, 3) for k, v in energy.items()} == {
11: 254.032,
12: 253.153,
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 @@ -196,7 +196,7 @@ async def energy_scan(
all_results = {}

for _ in range(count):
results = await self._api._at_command("ED", duration_exp)
results = await self._api._at_command("ED", bytes([duration_exp]))
results = {
channel: -int(rssi) for channel, rssi in zip(range(11, 27), results)
}
Expand Down

0 comments on commit 367fed5

Please sign in to comment.