Strict creation of the config for dynalite#34663
Merged
balloob merged 3 commits intohome-assistant:devfrom May 5, 2020
Merged
Conversation
this can avoid potential cases where a valid user name for an area is the same as one of the 'reserved' CONF values and then it will be converted
by config validation, so if we got there it has to be a software error
balloob
approved these changes
May 5, 2020
| if dev_cls in DEVICE_CLASSES: | ||
| return dev_cls | ||
| return DEFAULT_COVER_CLASS | ||
| assert dev_cls in DEVICE_CLASSES |
Member
There was a problem hiding this comment.
It's not good to use assert for production purposes. This should be reverted.
Contributor
Author
|
Ok. Will change it. Do I need a new PR or can I push to the same branch? |
Member
|
Please create a new PR. |
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.
Breaking change
Proposed change
The library expects a config that is similar to the one the component gets.
However, to decouple the API, it is converted via a map.
The problem is that this is risky as there may be multiple CONF items with the same string,
or there may be a user defined value that is similar to a defined CONF, and in
either of these cases, this will be converted to something wrong.
now the config is constructed, similar to the one in CV.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional 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: