Import
Functions
| Function | Description |
|---|---|
scan_wifi() | Scan for available networks |
connect_to_wifi() | Connect to a WiFi network |
get_wifi_status() | Get connection status |
toggle_internet_access() | Toggle internet access for a device |
set_internet_access() | Set internet access state for a device |
Classes
| Class | Description |
|---|---|
Wifi | Router management (Asus router parental control) |
Function Reference
scan_wifi(interface='wlan0')
Scan for available WiFi networks.
| Parameter | Type | Description |
|---|---|---|
interface | str | Wireless interface (default: ‘wlan0’) |
dict with keys:
access_points- List of network dicts, each containing:ssid- Network nameaddress- Access point MAC addressstrength- Signal strength as percentage (0-100)security- Security type (‘Open’ or ‘Secured’)
error- Error message (only present if scan failed)
connect_to_wifi(ssid, password, interface='wlan0')
Connect to a WiFi network.
| Parameter | Type | Description |
|---|---|---|
ssid | str | Network name |
password | str | Network password (empty string for open networks) |
interface | str | Wireless interface (default: ‘wlan0’) |
dict with keys:
success- Boolean indicating connection successmessage- Success message (whensuccessis True)error- Error message (whensuccessis False)method- Connection method used (‘nmcli’ or ‘wpa_supplicant’)interface- Interface used for connectiondhcp_status- DHCP status (‘requested’ or ‘failed’, optional)
get_wifi_status()
Get current WiFi connection status for all interfaces.
dict keyed by interface name, each value containing:
interface- Interface name (e.g., ‘wlan0’)ssid- Connected network name or ‘Not Connected’state- Connection state (‘Connected’, ‘Disconnected’, or ‘Available’)
toggle_internet_access()
Toggle internet access for a device via router parental controls.
set_internet_access(enabled)
Set internet access state for a device.
| Parameter | Type | Description |
|---|---|---|
enabled | bool | True to enable, False to disable |
Wifi Class (Router Management)
TheWifi class provides router management for Asus routers with parental control features.
Examples
Scan and Connect
Network Verification Test
Signal Strength Test
Connection Test
Hardware Requirements
| Requirement | Description |
|---|---|
| WiFi Hardware | USB adapter or built-in |
| Permissions | Root/sudo access required |
| Supported Security | WPA2, WPA3, Open |
Notes
- Lager Box must have WiFi hardware
- Root/sudo access required for most operations
- WPA2/WPA3 networks supported
- Open networks require empty password string (
'') - Interface defaults to ‘wlan0’
get_wifi_status()takes no parameters and returns all interfaces- Router management requires Asus router with parental control

