mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-25 01:12:04 +08:00
5f722d2c93
* start * start * lil more * add forget * fix forget button scrolling * push right a bit * fix forget press * add divider * fix scroll panel * better forget and overriding * revert this * check icon * cursor merge conflict fix * fix rounding and forget btn placement * scroll indicator * 65% * calibrate * try loading animation * push to device * top right * bottom right * no red * top left * bottom left * down 2px * WHY DOES NETWORK MANAGER KEEP CRASHING AHHH * reduce round trip calls in update_networks * clean up and combine getallaccesspoint and activeaccesspoint * cmt * animate big button over smoothly. super hacky, need to clean up * animate * remove old widgets and images * remove status label, tune loading animation opac back * connecting is a little buggy still * add back missing network and don't pop * some fixes * "clean up" * fix lag in animation * fix adding saved connection to start * remove saved network to start, divider * animate up, over, and down * revert for now * remove fancy complex animation for now, sorry nick * remove divider + clean up * more clean up * more clean up * fix forget button press * cmt * tweak loading animation behavior * new lock fix wifi * rm old lock * great catch by opus * clean up * debug * fix touch events that are down -> up in one frame (why it only bugged on mici) * clean up * eager forgetting * this SHOULD be full eager forget, more than i thought * fix wifi slash positioning * move forgotten networks after saved networks * temp keep * test on device * fix * see 65 * 5 best * fix double render double brightness * can click bottom right now * disable touch while animating * fix animation * can scroll while animating, not tap * not great yet * clean up * didn't work * always update networks after activation * stash * move to update_state * debug * debug * temp * fix ip and metered flickering when updating at high freq (or rare race condition) * fix * if you give it less than 8 chars it never clears connecting * lock no int * better wrong password handling * shake when wrong password * nm set connecting when it connects on its own * loading bottom right * sort connecting first * sort by unquantized to put strongest first * clean up * clean up nm * clean up nm * shorter * fix crash * 0.5s * debug * revert and try something else * stash * no * rev * use signals * more * not wrong password if ever connected after wrong * similar to gnome shell, don't save connection that never successfully activated. we do this by creating temporary memory connection with persist: volatile that deletes itself if failed, and then only write to disk when activated * clean up * cover all states * clear if connecting too * remove pritn * might need this for CoxWifi * whoops * save last pass * Revert "whoops" This reverts commit 83a133955246ce32dcf119ededd8b01b3162a866. * Revert "might need this for CoxWifi" This reverts commit cddb8b35be152ed154462b188283f9d5a844583d. * this may be less noisy for low strength networks, but less accurate as previous was reflecting nm state better * Revert "this may be less noisy for low strength networks, but less accurate as previous was reflecting nm state better" This reverts commit 740286c846556f32125a96bfe6ecf128300af0d8. * race condition with volotile not removing conn fast enough/update networks not firing fast enough * Revert "save last pass" This reverts commit 7249a58a18b11487fd0370cee36e40a17f7ac521. * revert some wifiman stuff to master * not needed * rm active ap * remove old dead code * do after * always send forgotten callback so we can't be stuck in forgetting state forever * reproduce race condition where connection removed signal takes a while to remove, then update networks keep is_saved true * fix from merge * nice, we can remove some eager code now for treating is_saved as not saved after forgot since it's live * more * rm * simplify passed in callbacks * clean up * need this one check back for wrong password to hide forget for a split second * opus says this is simpler 🤔 * Revert "opus says this is simpler 🤔" This reverts commit 71472e5b383d7f2083d95ba1188070f41ae14775. * another attempt * Revert "another attempt" This reverts commit 31f30babe656f9cad24399bc2196bb6e7ab79bbd. * fix from merge * some lcean up * fix * fixes to make work with new animation * clean up * this works too * simplify loading animation behavior for now, revert wifi scan time * clean up * temporary fix * stash * Revert "stash" This reverts commit 7471dbdc452807b33b4868a98dd8565681b2e44d. * stash * Revert "stash" This reverts commit e0e5e6e861734320ce5dea5626086784577cb334. * this check was because is_connected could have been stale from Network as the source * nm can show connected/connecting to network with 0 aps for a while if strength is low, move out of range under those states * stash * Revert "stash" This reverts commit 5ec3b454d54392523947f6477f551657d3863a6d. * todo * todo * order * don't need temporary fix anymore * cmt * order * unused i
62 lines
1.9 KiB
Python
62 lines
1.9 KiB
Python
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
|
|
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
|
|
CONNECTION_REMOVED = 38
|
|
SSID_NOT_FOUND = 53
|
|
NEW_ACTIVATION = 60
|
|
|
|
|
|
# NetworkManager constants
|
|
NM = "org.freedesktop.NetworkManager"
|
|
NM_PATH = '/org/freedesktop/NetworkManager'
|
|
NM_IFACE = 'org.freedesktop.NetworkManager'
|
|
NM_ACCESS_POINT_IFACE = 'org.freedesktop.NetworkManager.AccessPoint'
|
|
NM_SETTINGS_PATH = '/org/freedesktop/NetworkManager/Settings'
|
|
NM_SETTINGS_IFACE = 'org.freedesktop.NetworkManager.Settings'
|
|
NM_CONNECTION_IFACE = 'org.freedesktop.NetworkManager.Settings.Connection'
|
|
NM_ACTIVE_CONNECTION_IFACE = 'org.freedesktop.NetworkManager.Connection.Active'
|
|
NM_WIRELESS_IFACE = 'org.freedesktop.NetworkManager.Device.Wireless'
|
|
NM_PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
|
|
NM_DEVICE_IFACE = 'org.freedesktop.NetworkManager.Device'
|
|
NM_IP4_CONFIG_IFACE = 'org.freedesktop.NetworkManager.IP4Config'
|
|
|
|
NM_DEVICE_TYPE_WIFI = 2
|
|
NM_DEVICE_TYPE_MODEM = 8
|
|
|
|
# https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NM80211ApFlags
|
|
NM_802_11_AP_FLAGS_NONE = 0x0
|
|
NM_802_11_AP_FLAGS_PRIVACY = 0x1
|
|
NM_802_11_AP_FLAGS_WPS = 0x2
|
|
|
|
# https://developer.gnome.org/NetworkManager/1.26/nm-dbus-types.html#NM80211ApSecurityFlags
|
|
NM_802_11_AP_SEC_PAIR_WEP40 = 0x00000001
|
|
NM_802_11_AP_SEC_PAIR_WEP104 = 0x00000002
|
|
NM_802_11_AP_SEC_GROUP_WEP40 = 0x00000010
|
|
NM_802_11_AP_SEC_GROUP_WEP104 = 0x00000020
|
|
NM_802_11_AP_SEC_KEY_MGMT_PSK = 0x00000100
|
|
NM_802_11_AP_SEC_KEY_MGMT_802_1X = 0x00000200
|