wan status: report the current byte rates (GetAddonInfos NewByteSendRate / NewByteReceiveRate) #14

Open
opened 2026-12-02 22:25:16 +00:00 by christianmanivong · 0 comments
Owner

get_wan_status already calls WANCommonInterfaceConfig1.GetAddonInfos for the session byte totals (fritzbox.py:504-505), but leaves out the current rates the same answer carries: NewByteSendRate and NewByteReceiveRate (bytes per second).

netOrk's WAN page (NetOrk/netork#3019) draws the line's maximum rate, but cannot show what the line carries now against it: no driver reports a current rate.

What to build

  1. get_wan_status returns rate_down and rate_up in kbit/s (bytes/s × 8 / 1000, so they share the unit of max_bitrate_down/max_bitrate_up).
  2. A rate the box does not report is absent or None, never 0: _to_float turns a missing field into 0, which would read as an idle line.
  3. The two fields go into WANStatusDict in napalm-device-types as optional (NotRequired[int | None]), documented as a snapshot at poll time.

Test first

  • A fixture GetAddonInfos answer with both rates → kbit/s values; without them → absent/None.

Afterwards (netOrk, separate)

The WAN status card shows ↓/↑ now against the maximum as bars (mock-up M51 of the UI review, 2026-12-02).

Priority: P3 (important, not urgent): the WAN card is readable without it.

`get_wan_status` already calls `WANCommonInterfaceConfig1.GetAddonInfos` for the session byte totals (`fritzbox.py:504-505`), but leaves out the current rates the same answer carries: `NewByteSendRate` and `NewByteReceiveRate` (bytes per second). netOrk's WAN page (NetOrk/netork#3019) draws the line's maximum rate, but cannot show what the line carries now against it: no driver reports a current rate. ## What to build 1. `get_wan_status` returns `rate_down` and `rate_up` in kbit/s (bytes/s × 8 / 1000, so they share the unit of `max_bitrate_down`/`max_bitrate_up`). 2. A rate the box does not report is absent or `None`, never 0: `_to_float` turns a missing field into 0, which would read as an idle line. 3. The two fields go into `WANStatusDict` in napalm-device-types as optional (`NotRequired[int | None]`), documented as a snapshot at poll time. ## Test first - A fixture `GetAddonInfos` answer with both rates → kbit/s values; without them → absent/`None`. ## Afterwards (netOrk, separate) The WAN status card shows ↓/↑ now against the maximum as bars (mock-up M51 of the UI review, 2026-12-02). Priority: P3 (important, not urgent): the WAN card is readable without it.
christianmanivong added the
prio
P3
enhancement
labels 2026-12-02 22:25:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-fritzbox#14