Skip to content

Add friendly MAC names for connected clients#6

Merged
vpadman1 merged 1 commit intomainfrom
vignesh/friendly-mac-names
Apr 16, 2026
Merged

Add friendly MAC names for connected clients#6
vpadman1 merged 1 commit intomainfrom
vignesh/friendly-mac-names

Conversation

@vpadman1
Copy link
Copy Markdown
Owner

Summary

Tag connected devices with human-readable names so the dashboard shows "Vignesh's iPhone" instead of `AA:BB:CC:DD:EE:FF`.

  • aliases.py (new) — load/save/set/remove/resolve helpers backed by `~/.config/wifi-channel-optimizer/aliases.json`. MACs are normalized to uppercase on read and write so lookups don't depend on input casing.
  • main.py — the CLI becomes a Click group. Running `python main.py` with no subcommand still launches the dashboard (backward compatible). Three new subcommands manage aliases:
    • `main.py alias set `
    • `main.py alias list`
    • `main.py alias remove `
  • dashboard.py — `ClientsPanel` gains a "Device" column that shows the friendly name (falling back to raw MAC). Aliases are loaded once at startup.
  • tests/test_aliases.py (new) — 14 tests covering normalization, JSON roundtrip, invalid-file handling, mutators, and resolve fallback.
  • README.md — documents the alias subcommands.

Test plan

  • `uv run pytest -v` — 43/43 passing (29 existing + 14 new)
  • `uvx ruff check .` — clean
  • CI green
  • `python main.py alias set AA:BB:CC:DD:EE:FF "test"` — roundtrip a real alias

- aliases.py: load/save/set/remove/resolve helpers backed by
  ~/.config/wifi-channel-optimizer/aliases.json. MACs are normalized to
  uppercase-colon form on read and write.
- main.py: convert the CLI from a single command to a group that still
  launches the dashboard when invoked bare, and adds three subcommands:
    main.py alias set <mac> <name>
    main.py alias list
    main.py alias remove <mac>
- dashboard.py: ClientsPanel gains a new "Device" column that shows the
  friendly name (falling back to raw MAC). WifiDashboard accepts an
  aliases dict and otherwise loads the JSON file on startup.
- README.md: document the alias subcommands.
- tests/test_aliases.py: 14 tests covering normalization, JSON roundtrip,
  invalid-file handling, mutators, and resolve fallback.
@vpadman1 vpadman1 merged commit 5114461 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant