Skip to content

Commit

Permalink
Add the current channel as well
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Aug 15, 2024
1 parent aa58eaa commit ebc953d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions zigpy_cli/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ async def advanced_energy_scan(
scan_counts = {channel: num_energy_scans for channel in channels}

Check warning on line 253 in zigpy_cli/radio.py

View check run for this annotation

Codecov / codecov/patch

zigpy_cli/radio.py#L252-L253

Added lines #L252 - L253 were not covered by tests

scan_data = {

Check warning on line 255 in zigpy_cli/radio.py

View check run for this annotation

Codecov / codecov/patch

zigpy_cli/radio.py#L255

Added line #L255 was not covered by tests
"current_channel": app.state.network_info.channel,
"energy_scan": [],
"network_scan": [],
}
Expand Down Expand Up @@ -302,7 +303,10 @@ def iter_channels():
}
)

await asyncio.sleep(1)
if not isinstance(app, EzspControllerApplication):
json.dump(scan_data, output, separators=(",", ":"))
return

Check warning on line 308 in zigpy_cli/radio.py

View check run for this annotation

Codecov / codecov/patch

zigpy_cli/radio.py#L306-L308

Added lines #L306 - L308 were not covered by tests

for channel in channels:
networks = set()

Check warning on line 311 in zigpy_cli/radio.py

View check run for this annotation

Codecov / codecov/patch

zigpy_cli/radio.py#L310-L311

Added lines #L310 - L311 were not covered by tests

Expand All @@ -329,10 +333,11 @@ def iter_channels():
"channel": channel,
"lqi": lqi,
"rssi": rssi,
"network": {
**network.as_dict(),
"extendedPanId": str(network.extendedPanId),
},
"allowing_join": network.allowingJoin,
"extended_pan_id": str(network.extendedPanId),
"nwk_update_id": network.nwkUpdateId,
"pan_id": network.panId,
"stack_profile": network.stackProfile,
}
)

Expand Down

0 comments on commit ebc953d

Please sign in to comment.