Network#

class ignis.services.network.NetworkService(*args: Any, **kwargs: Any)#

A Network service. Uses NetworkManager.

property wifi: Wifi#
  • read-only

The Wi-Fi object.

property ethernet: Ethernet#
  • read-only

The Ethernet object.

property vpn: Vpn#
  • read-only

The Vpn object.

class ignis.services.network.Wifi(client: gi.repository.NM.Client)#

The class for controlling Wi-Fi devices.

property devices: list[WifiDevice]#
  • read-only

A list of Wi-Fi devices.

property is_connected: bool#
  • read-only

Whether at least one Wi-Fi device is connected to the network.

property icon_name: str#
  • read-only

The icon name of the first device in the list.

property enabled: bool#
  • read-write

Whether Wi-Fi is enabled.

class ignis.services.network.Ethernet(client: gi.repository.NM.Client)#

The class for controlling Ethernet devices.

property devices: list[EthernetDevice]#
  • read-only

A list of Ethernet devices.

property is_connected: bool#
  • read-only

Whether at least one Ethernet device is connected to the network.

property icon_name: str#
  • read-only

The general icon name for all devices, depends on is_connected property.

class ignis.services.network.Vpn(client: gi.repository.NM.Client)#

The class for controlling VPN connections.

property connections: list[VpnConnection]#
  • read-only

A list of VPN connections.

property active_vpn_id: str | None#
  • read-only

The id (name) of the first active vpn connection.

property is_connected: bool#
  • read-only

Whether at least one VPN connection is active.

property icon_name: str#
  • read-only

The general icon name for all vpn connections, depends on is_connected property.

class ignis.services.network.WifiDevice(device: gi.repository.NM.DeviceWifi, client: gi.repository.NM.Client)#

A Wifi device.

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.

property state: str | None#
  • read-only

The current state of the device or None if unknown.

property is_connected: bool#
  • read-only

Whether the device is connected to a Wi-Fi network.

scan() None#

Scan for Wi-Fi networks.

Return type:

None

class ignis.services.network.EthernetDevice(device: gi.repository.NM.DeviceEthernet, client: gi.repository.NM.Client)#

An Ethernet device.

property carrier: bool#
  • read-only

Whether the device has a carrier.

property perm_hw_address: str#
  • read-only

The permanent hardware (MAC) address of the device.

property speed: int#
  • read-only

The speed of the device.

property state: str | None#
  • read-only

The current state of the device or None if unknown.

property is_connected: bool#
  • read-only

Whether the device is connected to the network.

property name: str | None#
  • read-only

The name of the connection or None if unknown.

connect_to() None#

Connect this Ethernet device to the network.

Return type:

None

disconnect_from() None#

Disconnect this Ethernet device from the network.

Return type:

None

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).

property point: gi.repository.NM.AccessPoint#
  • read-only

An instance of NM.AccessPoint.

property bandwidth: int#
  • read-only

The channel bandwidth announced by the access point, in MHz.

property bssid: str#
  • read-only

The BSSID of the access point.

property frequency: int#
  • read-only

The frequency of the access point, in MHz.

property last_seen: int#
  • read-only

The timestamp for the last time the access point was found in scan results.

property max_bitrate: int#
  • read-only

The maximum bit rate of the access point, in kbit/s.

property ssid: str | None#
  • read-only

The SSID of the access point, or None if it is not known.

property strength: int#
  • read-only

The current signal strength of the access point, from 0 to 100.

property icon_name: str#
  • read-only

The current icon name for the access point. Depends on signal strength and current connection status.

property requires_password: bool#
  • read-only

Whether the access point requires a password to connect.

property is_connected: bool#
  • read-only

Whether the device is currently connected to this access point.

connect_to(password: str | None = None) None#

Connect to this access point.

Return type:

None

Args

password: Password to use. This has an effect only if the access point requires a password.

connect_to_graphical() None#

Display a graphical dialog to connect to the access point. The dialog will be shown only if the access point requires a password.

Return type:

None

class ignis.services.network.VpnConnection(connection: gi.repository.NM.RemoteConnection, client: gi.repository.NM.Client)#

A VPN connection.

property is_connected: bool#
  • read-only

Whether the device is connected to the network.

property name: str | None#
  • read-only

The id (name) of the vpn connection or None if unknown.

toggle_connection() None#

Toggle this VPN depending on it's is_connected property

Return type:

None

connect_to() None#

Connect to this VPN.

Return type:

None

disconnect_from() None#

Disconnect from this VPN.

Return type:

None