diff --git a/src/core/validation/widgets/yasb/wifi.py b/src/core/validation/widgets/yasb/wifi.py index d7b3134..791820f 100644 --- a/src/core/validation/widgets/yasb/wifi.py +++ b/src/core/validation/widgets/yasb/wifi.py @@ -9,10 +9,10 @@ }, 'wifi_icons': [ "\udb82\udd2e", # Icon for 0% strength - "\udb82\udd1f", # Icon for 1-25% strength - "\udb82\udd22", # Icon for 26-50% strength - "\udb82\udd25", # Icon for 51-75% strength - "\udb82\udd28" # Icon for 76-100% strength + "\udb82\udd1f", # Icon for 1-24% strength + "\udb82\udd22", # Icon for 25-49% strength + "\udb82\udd25", # Icon for 50-74% strength + "\udb82\udd28" # Icon for 75-100% strength ], 'ethernet_icon': "\ueba9" } diff --git a/src/core/widgets/yasb/wifi.py b/src/core/widgets/yasb/wifi.py index b822c3b..0c377ef 100644 --- a/src/core/widgets/yasb/wifi.py +++ b/src/core/widgets/yasb/wifi.py @@ -140,7 +140,7 @@ def _get_wifi_strength(self): for connection in connections: if connection.get_network_connectivity_level() == NetworkConnectivityLevel.INTERNET_ACCESS: signal_strength = connection.get_signal_bars() - return signal_strength * 20 + return signal_strength return 0 def _get_wifi_name(self): @@ -151,17 +151,14 @@ def _get_wifi_name(self): return "No WiFi" def _get_wifi_icon(self): - # Map strength to its corresponding icon strength = self._get_wifi_strength() if strength == 0: return self._wifi_icons[0], strength - elif strength <= 20: - return self._wifi_icons[1], strength - elif strength <= 40: - return self._wifi_icons[2], strength - elif strength <= 60: - return self._wifi_icons[3], strength - elif strength <= 80: - return self._wifi_icons[3], strength - else: - return self._wifi_icons[4], strength + elif strength == 1: + return self._wifi_icons[1], strength * 25 + elif strength == 2: + return self._wifi_icons[2], strength * 25 + elif strength == 3: + return self._wifi_icons[3], strength * 25 + elif strength == 4: + return self._wifi_icons[4], strength * 25