Conversation
…Devices Monitor pattern Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
…es and None domain Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error 500 in config_flow.py for integration reconfiguration
Fix HTTP 500 errors in config flow with defensive error handling
Feb 17, 2026
Copilot
AI
changed the title
Fix HTTP 500 errors in config flow with defensive error handling
v1.4.0: Prevent HTTP 500 errors in config flow with defensive error handling
Feb 17, 2026
… practices Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
…ctices Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot
AI
changed the title
v1.4.0: Prevent HTTP 500 errors in config flow with defensive error handling
v1.4.0: Prevent HTTP 500 errors and refactor to HA integration best practices
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Config flow crashes with HTTP 500 when encountering empty entity lists, invalid domains, or schema construction failures during configuration. Additionally, code structure did not follow Home Assistant integration conventions used by professional integrations like Battery Devices Monitor.
Error Handling
Wrapped all flow steps in defensive error boundaries:
Example:
Structure Refactoring
Aligned with HA best practices:
HADailyCounterConfigFlow→FlowHandlerHADailyCounterOptionsFlow→OptionsFlowHandlerconfig_flow.py(removed separateoptions_flow.py)dict[str, Any]vsDict[str, Any])Files changed:
config_flow.py: +402/-116 lines (now 540 lines, contains both flow handlers)options_flow.py: deleted (217 lines)manifest.json: version → 1.4.0CHANGELOG.md: release notesStructure now matches Battery Devices Monitor and other professional HA integrations where both flow handlers reside in single file.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.