Skip to content

Commit ebc953d

Browse files
committed
Add the current channel as well
1 parent aa58eaa commit ebc953d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

zigpy_cli/radio.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ async def advanced_energy_scan(
253253
scan_counts = {channel: num_energy_scans for channel in channels}
254254

255255
scan_data = {
256+
"current_channel": app.state.network_info.channel,
256257
"energy_scan": [],
257258
"network_scan": [],
258259
}
@@ -302,7 +303,10 @@ def iter_channels():
302303
}
303304
)
304305

305-
await asyncio.sleep(1)
306+
if not isinstance(app, EzspControllerApplication):
307+
json.dump(scan_data, output, separators=(",", ":"))
308+
return
309+
306310
for channel in channels:
307311
networks = set()
308312

@@ -329,10 +333,11 @@ def iter_channels():
329333
"channel": channel,
330334
"lqi": lqi,
331335
"rssi": rssi,
332-
"network": {
333-
**network.as_dict(),
334-
"extendedPanId": str(network.extendedPanId),
335-
},
336+
"allowing_join": network.allowingJoin,
337+
"extended_pan_id": str(network.extendedPanId),
338+
"nwk_update_id": network.nwkUpdateId,
339+
"pan_id": network.panId,
340+
"stack_profile": network.stackProfile,
336341
}
337342
)
338343

0 commit comments

Comments
 (0)