Repository navigation
fix(options): allow clearing ignored_addresses when omitted or empty in UI (#612) - #666
Merged
Conversation
…in UI (OpenWebNet-HA#612) - Read CONF_IGNORED_ADDRESSES with fallback to empty string so clearing or omitting the field updates self.options to [] - Wrap multiline TextSelector with vol.Maybe so None and omitted inputs pass schema validation cleanly - Add comprehensive options flow tests covering empty string, omitted key (HA frontend behavior), None, and single comma inputs
…s and document omission (OpenWebNet-HA#612)
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
GreenGrassBlueOcean
merged commit Oct 9, 2026
0311277
into
OpenWebNet-HA:v2-phase1-architecture
16 checks passed
GreenGrassBlueOcean
deleted the
fix/options-flow-clear-ignored-addresses
branch
October 21, 2026 19:35
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.
Description
Fixes an issue reported in #612 (specifically issuecomment-6076280940) where clearing the Ignored addresses (
ignored_addresses) field in the MyHOME Options flow had no effect, causing previously ignored addresses to keep reappearing upon reopening the configure dialog.Root Cause
ha-selector-text.ts), clearing a non-required text selector field causes_handleChangeto setvalue = undefined.ha-formmerges{ [schema.name]: undefined }.JSON.stringifydrops all properties withundefinedvalues.ignored_addresseskey completely.MyhomeOptionsFlowHandler.async_step_user, the code checked:CONF_IGNORED_ADDRESSESwas absent fromuser_input, this block was skipped entirely, preserving whatever entries were already loaded inself.options(fromself.config_entry.options).self.options, persisting the old addresses back intoentry.options.Changes
config_flow.py:user_input.get(CONF_IGNORED_ADDRESSES, "")unconditionally instead of checkingif CONF_IGNORED_ADDRESSES in user_input. Becausevalidate_ignored_addresses("")returns([], True), clearing the field in the UI now properly emptiesself.options[CONF_IGNORED_ADDRESSES] = [].selector.TextSelectorinvol.Maybe(...)soNoneand omitted values pass voluptuous schema validation cleanly.tests/test_config_flow.py:ignored_addressesvia empty string"", key omission (matching HA frontend behavior),None, and single comma,(UI workaround).suggested_value == "".Related to #612