Remove unreliable max bitrate from Speed line

NM.AccessPoint.get_max_bitrate() reports a value that doesn't account
for MIMO spatial streams or extended channel widths, leading to the
negotiated speed appearing higher than the supposed max (e.g. 1729 vs 540).
Remove the max from the connected info Speed line where the comparison
is misleading. Keep it in the AP list where it serves as a relative
indicator between access points.
This commit is contained in:
Jalil Arfaoui 2026-03-19 13:39:51 +01:00
parent 244d69919d
commit 87c5001da1
4 changed files with 6 additions and 17 deletions

View file

@ -3,7 +3,7 @@
"name": "WiFi Signal Plus",
"description": "Displays WiFi generation (4/5/6/7) in the top bar with detailed connection info on hover",
"shell-version": ["45", "46", "47", "48", "49"],
"version": 6,
"version": 7,
"url": "https://github.com/JalilArfaoui/gnome-extension-wifi-signal-plus",
"donations": {
"liberapay": "Jalil"

View file

@ -603,27 +603,18 @@ export default class WifiSignalPlusExtension extends Extension {
}
private formatBitrate(info: ConnectedInfo): string {
const { txBitrate, rxBitrate, bitrate, maxBitrate } = info;
const { txBitrate, rxBitrate, bitrate } = info;
let speed: string;
if (txBitrate !== null && rxBitrate !== null) {
const tx = txBitrate as number;
const rx = rxBitrate as number;
speed = tx === rx ? `${tx} Mbit/s` : `${tx}${rx} Mbit/s`;
return tx === rx ? `${tx} Mbit/s` : `${tx}${rx} Mbit/s`;
} else if (txBitrate !== null) {
speed = `${txBitrate} Mbit/s`;
return `${txBitrate} Mbit/s`;
} else if (rxBitrate !== null) {
speed = `${rxBitrate} Mbit/s`;
} else {
speed = `${bitrate} Mbit/s`;
return `${rxBitrate} Mbit/s`;
}
const max = maxBitrate as number;
if (max > 0) {
speed += ` (max ${max})`;
}
return speed;
return `${bitrate} Mbit/s`;
}
private formatChannelWidth(width: ChannelWidthMHz | null): string {

View file

@ -142,7 +142,6 @@ export interface ConnectedInfo extends BaseConnectionInfo {
readonly channelWidth: ChannelWidthMHz | null;
readonly txBitrate: BitrateMbps | null;
readonly rxBitrate: BitrateMbps | null;
readonly maxBitrate: BitrateMbps;
}
export interface ScannedNetwork {

View file

@ -297,7 +297,6 @@ export class WifiInfoService {
channelWidth: iwInfo.channelWidth,
txBitrate: iwInfo.txBitrate,
rxBitrate: iwInfo.rxBitrate,
maxBitrate: asBitrateMbps(ap.get_max_bitrate() / 1000),
});
}