Skip to content

Commit 367fed5

Browse files
authored
Fix energy scan duraton (#168)
1 parent b8564a8 commit 367fed5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test_application.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ async def test_energy_scan(app):
709709
energy = await app.energy_scan(
710710
channels=list(range(11, 27)), duration_exp=time_s, count=count
711711
)
712-
assert app._api._at_command.mock_calls == [mock.call("ED", time_s)] * count
712+
assert app._api._at_command.mock_calls == [mock.call("ED", bytes([time_s]))] * count
713713
assert {k: round(v, 3) for k, v in energy.items()} == {
714714
11: 254.032,
715715
12: 253.153,

zigpy_xbee/zigbee/application.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def energy_scan(
196196
all_results = {}
197197

198198
for _ in range(count):
199-
results = await self._api._at_command("ED", duration_exp)
199+
results = await self._api._at_command("ED", bytes([duration_exp]))
200200
results = {
201201
channel: -int(rssi) for channel, rssi in zip(range(11, 27), results)
202202
}

0 commit comments

Comments
 (0)