Add setup type hints to yamaha#63811
Merged
frenck merged 9 commits intohome-assistant:devfrom Jan 10, 2022
Merged
Conversation
epenet
commented
Jan 10, 2022
epenet
commented
Jan 10, 2022
epenet
commented
Jan 10, 2022
|
|
||
| def __init__(self, config: ConfigType, discovery_info: DiscoveryInfoType) -> None: | ||
| def __init__( | ||
| self, config: ConfigType, discovery_info: DiscoveryInfoType | None |
Contributor
Author
There was a problem hiding this comment.
If discovery_info wasn't optional, it wouldn't make sense to check it afterwards:
if discovery_info is not None:
self.name = discovery_info.get("name")
epenet
commented
Jan 10, 2022
| self.source_ignore = config.get(CONF_SOURCE_IGNORE) | ||
| self.source_names = config.get(CONF_SOURCE_NAMES) | ||
| self.zone_ignore = config.get(CONF_ZONE_IGNORE) | ||
| self.zone_ignore = config.get(CONF_ZONE_IGNORE, []) |
Contributor
Author
There was a problem hiding this comment.
This should be handled automatically be the schema validation, but it seemed easier to change it here than to adjust the tests. I'm happy to adjust the tests instead if so desired.
Member
There was a problem hiding this comment.
Well, in this location, it isn't correct. So, we should adjust the tests in that case.
Contributor
Author
There was a problem hiding this comment.
I struggled a bit with that one as I am not so familiar with the test.
I think it's good now.
frenck
requested changes
Jan 10, 2022
Co-authored-by: Franck Nijhof <git@frenck.dev>
frenck
approved these changes
Jan 10, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
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: