Add opentherm_gw config flow#27148
Conversation
Bump pyotgw to 0.5b0 (required for connection testing) Existing entries in configuration.yaml will be converted to config entries and ignored in future runs.
Pylint fixes.
balloob
left a comment
There was a problem hiding this comment.
Please include a test for your config flow.
If you use python3 -m script.scaffold config_flow, it generates tests that are pretty much ready to use.
Remove non-essential options from config flow. Restructure config entry data.
|
All requested changes have been made. |
|
🎉 awesome 🐬 |
| entries = [e.data for e in self.hass.config_entries.async_entries(DOMAIN)] | ||
|
|
||
| if gw_id in [e[CONF_ID] for e in entries]: | ||
| return self._show_form({"base": "id_exists"}) |
There was a problem hiding this comment.
If we use the CONF_ID key instead of "base" the form will show the error message next to the corresponding form item.
| "name": "Name", | ||
| "device": "Path or URL", | ||
| "id": "ID", | ||
| "precision": "Climate temperature precision", |
There was a problem hiding this comment.
This key doesn't seem used.
| "device": "Path or URL", | ||
| "id": "ID", | ||
| "precision": "Climate temperature precision", | ||
| "floor_temperature": "Floor climate temperature" |
| except SerialException: | ||
| return self._show_form({"base": "serial_error"}) | ||
|
|
||
| if res: |
| @@ -0,0 +1,23 @@ | |||
| { | |||
| "config": { | |||
There was a problem hiding this comment.
We don't add other translations in the config flow PR. Just the default English translation.
Translations are handled separately via Lokalise and synced regularly to github.
Description:
Add support for config entries in
opentherm_gw.Existing configurations in
configuration.yamlwill be converted on first start and then ignored.Related issue (if applicable): N/A
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10584
Example entry for
configuration.yaml(if applicable):N/A
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.If the code does not interact with devices:
N/A