Fix: MQTT reconfiguration reverts to old settings on save #370
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.
Problem
When reconfiguring the integration via the "MQTT Broker" option, changes to the connection details (e.g., updating the Broker IP or port) were not being saved. After submitting the new details, the configuration would revert to the previous values.
Cause
The
async_step_configure_serial_portmethod was callingself.get_options()at the start of the step. This causedself.optionsto be reloaded from the stored config entry, overwriting the new values that had just been set in the precedingasync_step_mqtt_configstep.Fix
Removed the redundant
self.get_options()call incustom_components/ramses_cc/config_flow.py. Theself.optionsdictionary is already correctly populated by the previous step, so reloading it is unnecessary and destructive in this context.Verification