-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add seperate setup flow to coordinator #447
Conversation
- Seperate flow for setup phase - Schedule MQTT connection only after integration has initialized - Wrap MQTT startup in try/except for proper unlocking
Converted to draft since this probably needs a different approach |
Why does this need a different approach? I'm trying to understand how the coordinator is involved during the setup (ConfigFlow?) i.e. how does |
The approach that is currently in this draft is mostly incomplete and has corner cases for multiple vehicles, integration reloading
ConfigFlow is the configuration of the integration. Once the integration is configure, it can be setup. Those are two different things. In setup, Have a look at the coordinators parent class, they are partially overriden by us only |
My idea is to only request data during first setup of coordinator that is needed for the actual initialisation, and then do a normal data pull. This should hopefully make integration setup a lot more robust |
Fixes after running some tests while MQTT is down |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just one minor change
Good catch, will update the PR |
Co-authored-by: EnergyX <[email protected]>
This alters the coordinator setup as follows:
This should allow the integration to succesfully set-up, even if MQTT is unavailable, and the REST API is being wonky instead of blocking HA startup or failing to initialise.