Skip to content

Improve Growatt Server config flow with region dropdown#159329

Merged
joostlek merged 3 commits into
home-assistant:devfrom
johanzander:growatt-server-region-dropdown
Dec 19, 2025
Merged

Improve Growatt Server config flow with region dropdown#159329
joostlek merged 3 commits into
home-assistant:devfrom
johanzander:growatt-server-region-dropdown

Conversation

@johanzander
Copy link
Copy Markdown
Contributor

@johanzander johanzander commented Dec 17, 2025

Proposed change

  1. Replace raw server URLs with user-friendly region names in both password and token authentication flows. This improves the user experience by showing clear region names instead of technical URLs in the dropdown selector.
  2. Update URL/regions to be aligned with both official Growatt and Home Assistant documentation: https://www.home-assistant.io/integrations/growatt_server/

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Technical changes:

  • Converted SERVER_URLS list to SERVER_URLS_NAMES dictionary mapping region keys to URLs
  • Added missing Era/Atess Power server option that was documented but not available
  • Implemented SelectSelector with translation_key="region" for proper localization
  • Added server region selection to token authentication (previously missing)
  • Updated tests to include CONF_URL in token authentication fixture
  • Marks docs-configuration-parameters quality scale rule as done (Silver tier)

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

N/A - No dependency changes for this PR.

To help with the load of incoming pull requests:

Comment thread homeassistant/components/growatt_server/config_flow.py Outdated
johanzander and others added 2 commits December 18, 2025 21:49
Separate the region selection input from the URL storage by using
a dedicated CONF_REGION configuration key. This improves code clarity
by distinguishing between user-friendly region names and actual URLs.

- Add CONF_REGION constant
- Update config flow forms to use CONF_REGION for region selector
- Convert CONF_REGION to CONF_URL during processing
- Update tests to use CONF_REGION

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@joostlek joostlek merged commit e0cb56a into home-assistant:dev Dec 19, 2025
36 checks passed
@johanzander johanzander deleted the growatt-server-region-dropdown branch December 19, 2025 14:45
jcisio pushed a commit to jcisio/home-assistant-core that referenced this pull request Dec 19, 2025
…nt#159329)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants