Config Entry migrations#20888
Conversation
|
I think that if a new entry is needed, that can be implemented by initiating a new flow which, on completion, removes the old flow. That's how we do it for Hue if a new bridge is registered on a new IP, all other entries for that bridge are killed. |
|
@balloob @MartinHjelmare This is ready for final review. Build is passing--it's seems to coveralls that's the issue. I have a pending SmartThings component improvement to get in before the next release so people don't have to re-authorize the SmartApp, which is dependent on this. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good! @balloob should merge.
|
You can try rebasing on latest dev. Coveralls seems flaky. |
I can try that tonight if not already merged. :) . |
Description:
Implements basic Config Entry migration functionality:
component.async_setup_entry)ConfigFlowand if they do not match determines migration is needed.async_migrate_entry(hass, entry) -> boolwhere the entry can be directly updated and will be saved. ReturnTrueif migration was successful or not needed.ENTRY_STATE_MIGRATION_ERRORrepresents failure to migrate.