From 9e5e6a5d95a476004a19258999c766c592f1db8c Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Wed, 24 Jun 2026 23:25:49 +0200 Subject: [PATCH] feat: ChannelScanEntryDict + get_channel_scan / push_radio_channel interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds ChannelScanEntryDict TypedDict for iw-scan results (bssid, ssid, frequency, channel, signal_dbm, channel_width, band). AccessPointDriver gains two new interface methods: - get_channel_scan(mode) → dict[iface, list[ChannelScanEntryDict]] Default returns {} so non-implementing drivers degrade gracefully. - push_radio_channel(radio, channel) — abstract (raises NotImplementedError). Co-Authored-By: Claude Sonnet 4.6 --- napalm_device_types/access_point.py | 1 + napalm_device_types/models.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/napalm_device_types/access_point.py b/napalm_device_types/access_point.py index ac0c8b8..3db3874 100644 --- a/napalm_device_types/access_point.py +++ b/napalm_device_types/access_point.py @@ -14,6 +14,7 @@ from typing import Any, Dict, List from napalm_device_types.base import DeviceTypeDriver from napalm_device_types._ucd_metrics import IF_SKIP_DEFAULT, collect_ucd_metrics from napalm_device_types.models import ( + ChannelScanEntryDict, Dot1XConfigDict, FastTransitionConfigDict, HealthMetricsDict, diff --git a/napalm_device_types/models.py b/napalm_device_types/models.py index 1685bf1..bcf2a58 100644 --- a/napalm_device_types/models.py +++ b/napalm_device_types/models.py @@ -105,6 +105,18 @@ class RadioStatusDict(TypedDict): frequency: float +class ChannelScanEntryDict(TypedDict): + """One neighboring AP entry as returned by get_channel_scan().""" + + bssid: str + ssid: str + frequency: int # centre frequency in MHz, e.g. 2437 + channel: int # channel number, e.g. 6 + signal_dbm: int # RSSI in dBm, e.g. -72 + channel_width: int # MHz: 20 / 40 / 80 / 160; 0 if unknown + band: str # "2.4GHz" | "5GHz" | "6GHz" + + class WirelessConfigDict(TypedDict): country_code: str regulatory_domain: str