-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Aurora abb defer unique_id assignment during yaml import #58887
Aurora abb defer unique_id assignment during yaml import #58887
Conversation
cf7e2e5
to
9132e80
Compare
I have tried rebasing to see if that fixes the test failures (which seemed to be unrelated to this change). |
raise ConfigEntryNotReady( | ||
"Failed to connect to inverter: no such COM port" | ||
) from error |
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.
If there is no such device, it can't recover and so we should mark setup as failed instead of "failed but might work in a bit"
raise ConfigEntryNotReady( | |
"Failed to connect to inverter: no such COM port" | |
) from error | |
return False |
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.
If device is a USB-RS485 adaptor perhaps it will work when it is plugged back in?
But retry every 5sec is probably not a good idea in this case.
I don't really mind. My initial approach was 'no response' is the only one we want to allow deferring for. All others are errors which should stop. But that means restart HA is the only way to 'try again'.
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.
I have switched them to log errors then return False
. Hopefully that satisfies all.
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.
Thanks!
* Defer unique_id assignment during yaml import if dark * Back out variable name change to simplify. * Allow config flow yaml setup deferral. * Fix deferred yaml import * Code review: only wrap necessary lines in try blk * Code review: catch possible duplicate unique_id * Simplify assignment. * Code review: use timedelta to retry yaml import * Code review: if a different error occurs, raise it * Remove current config entry if duplicate unique_id * Code review: remove unnecessary line. * Code review: revert change, leave to other PR. * Code review: remove unnecessary patch & min->sec * Remove unnecessary else after raise. * Increase test coverage. * Check the number of config entries at each stage * Raise ConfigEntryNotReady when connection fails. * Log & return false for error on yaml import
Breaking change
Proposed change
As implemented in #58504, the yaml import now allows the unique_id to be left as
None
until the setup can complete properly. This is preferred over the old solution of assigning an arbitrary unique_id.It also means that serial numbers, FW versions etc can be assigned correctly etc rather than using dummy values.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: