Skip to content

Show human-readable status labels in CLI device tables - #91

Open
valentinocossar wants to merge 1 commit into
jfmlima:mainfrom
valentinocossar:fix/cli-status-labels
Open

Show human-readable status labels in CLI device tables#91
valentinocossar wants to merge 1 commit into
jfmlima:mainfrom
valentinocossar:fix/cli-status-labels

Conversation

@valentinocossar

@valentinocossar valentinocossar commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • format_device_status() in packages/cli/src/cli/presentation/styles.py was interpolating the raw Status enum value (e.g. update_available, no_update_needed) straight into Rich markup, unlike every other column in the same tables which is already humanized (Unknown/N/A fallbacks, friendly success/warning messages).
  • Adds a status → label map covering all 8 Status values (reusing the same wording already used on the web frontend's status.* i18n namespace where they overlap) and a get_device_status_label() helper, used by format_device_status() alongside the existing color logic.
  • Single change point; propagates automatically to all 3 call sites (_format_discovered_devices_table, _format_legacy_device_table, commands/common.py::format_device_table) since they all funnel through format_device_status().
  • Adds direct unit test coverage for the new label mapping (packages/cli/tests/unit/presentation/test_styles.py), previously only exercised indirectly.

Test plan

  • Existing + new CLI test suite passes (143 tests)
  • Manual: shelly-manager scan <range> and shelly-manager device list <range> — verified against real devices on both commands, Status column shows "Update Available", "Up to Date", "Detected", etc. instead of raw enum strings

🤖 Generated with Claude Code

https://claude.ai/code/session_01VApHaH9KZ6BPV9SwvUAVLH

format_device_status() was interpolating the raw Status enum value
(e.g. "update_available") straight into Rich markup instead of a
readable label, unlike every other column in the same table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VApHaH9KZ6BPV9SwvUAVLH
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