NetworkManager: add more device states (#37235)

* safe

* missing states

* add enum for nmdevicestatereason

* rm for now

* fix links
This commit is contained in:
Shane Smiskol
2026-02-17 16:25:44 -08:00
committed by GitHub
parent 1f85860f7e
commit fd34659dc3
2 changed files with 20 additions and 11 deletions
+15 -4
View File
@@ -3,17 +3,31 @@ from enum import IntEnum
# NetworkManager device states
class NMDeviceState(IntEnum):
# https://networkmanager.dev/docs/api/1.46/nm-dbus-types.html#NMDeviceState
UNKNOWN = 0
UNMANAGED = 10
UNAVAILABLE = 20
DISCONNECTED = 30
PREPARE = 40
STATE_CONFIG = 50
CONFIG = 50
NEED_AUTH = 60
IP_CONFIG = 70
IP_CHECK = 80
SECONDARIES = 90
ACTIVATED = 100
DEACTIVATING = 110
FAILED = 120
class NMDeviceStateReason(IntEnum):
# https://networkmanager.dev/docs/api/1.46/nm-dbus-types.html#NMDeviceStateReason
NONE = 0
UNKNOWN = 1
NO_SECRETS = 7
SUPPLICANT_DISCONNECT = 8
NEW_ACTIVATION = 60
# NetworkManager constants
NM = "org.freedesktop.NetworkManager"
NM_PATH = '/org/freedesktop/NetworkManager'
@@ -30,9 +44,6 @@ NM_IP4_CONFIG_IFACE = 'org.freedesktop.NetworkManager.IP4Config'
NM_DEVICE_TYPE_WIFI = 2
NM_DEVICE_TYPE_MODEM = 8
NM_DEVICE_STATE_REASON_NO_SECRETS = 7
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8
NM_DEVICE_STATE_REASON_NEW_ACTIVATION = 60
# https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NM80211ApFlags
NM_802_11_AP_FLAGS_NONE = 0x0