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 config flow for Ecovacs #108111
Add config flow for Ecovacs #108111
Conversation
Hey there @OverloadUT, @mib1185, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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.
from functional point of view, it works as expected
- correct repair issue is shown when validation during import fails (tested with intentional wrong credentials)
- import of correct yaml data is successful
- create a new config entry is successful
- validation during config flow is also correct (wrong data, causes corresponding error messages)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
type=selector.TextSelectorType.PASSWORD | ||
) | ||
), | ||
vol.Required(CONF_COUNTRY): vol.All(vol.Lower, cv.string), |
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.
Country selector will be used in a follow-up PR, where I also make it optional to specify the continent
_LOGGER.error("Ecovacs login failed due to wrong username/password") | ||
raise ConfigEntryError("invalid username or password") from ex | ||
except RuntimeError as ex: | ||
_LOGGER.exception("Unexpected exception") |
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.
Normally we don't log when we try again to avoid spamming the log. We can pass the message as an exception argument, which will be logged.
It's always ok to log at debug level, besides performance considerations. ConfigEntryNotReady
will log the message at debug level.
We also normally don't catch unknown exceptions outside of the config flow.
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.
Will add the error handling in a follow-up including the new lib
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.
Looks good!
Test failure unrelated |
Breaking change
The YAML configuration for Ecovacs is deprecated and will be removed in 2024.8. Please remove it from your configuration.
Proposed change
SSIA
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: