Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use common strings in opentherm_gw config flow #42211

Merged
merged 5 commits into from Oct 25, 2020

Conversation

wouterbaake
Copy link
Contributor

@wouterbaake wouterbaake commented Oct 22, 2020

Proposed change

Contribute to issue #40578

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

I did not convert strings device or id_exists to common strings because there are no common strings that fully cover the intended message.
For device it is uncommon that either a path (/dev/ttyS1) or an URL can be entered.
For id_exists, the error message describes that the given ID is the issue and not the combinatie of ID and device.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @mvn23, mind taking a look at this pull request as its been labeled with an integration (opentherm_gw) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

Comment on lines 16 to 17
"serial_error": "[%key:common::config_flow::error::cannot_connect%]",
"timeout": "[%key:common::config_flow::error::cannot_connect%]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to use the same error for both cases, we may as well merge them into one cannot_connect error condition in the config flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Originally I did not want to touch the code, but I'll add a commit to reduce it to a single check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, commited that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I shouldn't have commited without running the tests again, so another commit to fix the test.

Copy link
Contributor

@mvn23 mvn23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the work. The only small change you could additionally consider is a more general name for the error key (timeout may be confusing for future code maintenance if it's not necessarily caused by a timeout)

@wouterbaake
Copy link
Contributor Author

Ok, changed the name of the error key.

Copy link
Member

@springstan springstan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 馃憤

Dev automation moved this from Needs review to Reviewer approved Oct 25, 2020
@springstan springstan merged commit e6400fc into home-assistant:dev Oct 25, 2020
Dev automation moved this from Reviewer approved to Done Oct 25, 2020
@wouterbaake wouterbaake deleted the opentherm_gw_localization branch October 26, 2020 06:29
rajlaud pushed a commit to rajlaud/home-assistant that referenced this pull request Oct 28, 2020
* Use common strings in opentherm_gw config flow

* Combine TimeourError and SerialException handling

* Fixed test_form_connection_error

* And then fix the flake8 error...

* Change "timeout" to "cannot_connect" msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants