Network#
- class ignis.services.network.NetworkService(*args: Any, **kwargs: Any)#
A Network service. Uses
NetworkManager
.
- class ignis.services.network.Wifi(client: gi.repository.NM.Client)#
The class for controlling Wi-Fi devices.
- new_device(*args)#
Emitted when a new Wi-FI device is added.
- Parameters:
device (
WifiDevice
) -- An instance of the device.
- property devices: list[WifiDevice]#
read-only
A list of Wi-Fi devices.
- class ignis.services.network.Ethernet(client: gi.repository.NM.Client)#
The class for controlling Ethernet devices.
- new_device(*args)#
Emitted when a new Ethernet device is added.
- Parameters:
device (
EthernetDevice
) -- An instance of the device.
- property devices: list[EthernetDevice]#
read-only
A list of Ethernet devices.
- class ignis.services.network.Vpn(client: gi.repository.NM.Client)#
The class for controlling VPN connections.
- new_connection(*args)#
Emitted when a new VPN connection is added.
- Parameters:
connection (
VpnConnection
) -- An instance of the VPN connection.
- new_active_connection(*args)#
Emitted when a VPN connection is activated.
- Parameters:
connection (
VpnConnection
) -- An instance of the newly activated VPN connection.
- property connections: list[VpnConnection]#
read-only
A list of all VPN connections.
- property active_connections: list[VpnConnection]#
read-only
A list of active VPN connections.
- class ignis.services.network.WifiDevice(device: gi.repository.NM.DeviceWifi, client: gi.repository.NM.Client)#
A Wifi device.
- removed()#
Emitted when this Wi-Fi device is removed.
- new_access_point(*args)#
Emitted when a new access point is added.
- Parameters:
access_point (
WifiAccessPoint
) -- An instance of the access point.
- property access_points: list[WifiAccessPoint]#
read-only
A list of access points (Wi-FI networks).
- property ap: WifiAccessPoint#
read-only
The currently active access point.
- class ignis.services.network.EthernetDevice(device: gi.repository.NM.DeviceEthernet, client: gi.repository.NM.Client)#
An Ethernet device.
- removed()#
Emitted when this Ethernet device is removed.
- class ignis.services.network.WifiAccessPoint(point: gi.repository.NM.AccessPoint, client: gi.repository.NM.Client, device: gi.repository.NM.DeviceWifi)#
A Wi-Fi access point (Wi-Fi network).
- removed()#
Emitted when this access point is removed.
- property point: gi.repository.NM.AccessPoint#
read-only
An instance of
NM.AccessPoint
.
- property last_seen: int#
read-only
The timestamp for the last time the access point was found in scan results.
- property icon_name: str#
read-only
The current icon name for the access point. Depends on signal strength and current connection status.
- property security: Literal['WPA1', 'WPA2/WPA3'] | None#
read-only
The security protocol of the access point (
WPA1
,WPA2/WPA3
).
- property psk: str | None#
read-write
The stored Pre-shared key (password) for the access point.
None
if there is no a saved psk for this access point.Warning
After setting this property, you have to manually call
commit_changes_async()
to save changes to the disk.
- property is_connected: bool#
read-only
Whether the device is currently connected to this access point.
- commit_changes_async(callback: Callable | None = None) None #
Asynchronously commit changes to the connection.
- connect_to(password: str | None = None, callback: Callable | None = None) None #
Asynchronously connect to this access point.
- Return type:
- Args
password: Password to use. This has an effect only if the access point requires a password. callback: A function to call when connection is established or added. The function will receive
self
and an instance ofNM.ActiveConnection
as arguments.
- connect_to_graphical(callback: Callable | None = None) None #
Display a graphical dialog to connect to the access point. The dialog will be shown only if the access point requires a password. This function is asynchronous.
- Parameters:
callback (
Callable
|None
, default:None
) -- A function to call when connection is established or added. The function will receiveself
and an instance ofNM.ActiveConnection
as arguments.- Return type:
- disconnect_from(callback: Callable | None = None) None #
Asynchronously disconnect from this access point.
- clear_secrets() None #
Clear a stored secret. This will reset security settings (PSK and security protocol). :rtype:
None
Warning
After calling this method, you have to manually call
commit_changes_async()
to save changes to the disk.
- class ignis.services.network.VpnConnection(connection: NM.Connection | NM.ActiveConnection, client: gi.repository.NM.Client)#
A VPN connection.
- removed()#
Emitted when this VPN connection is removed.