Skip to content

Strict creation of the config for dynalite#34663

Merged
balloob merged 3 commits intohome-assistant:devfrom
ziv1234:fix26
May 5, 2020
Merged

Strict creation of the config for dynalite#34663
balloob merged 3 commits intohome-assistant:devfrom
ziv1234:fix26

Conversation

@ziv1234
Copy link
Copy Markdown
Contributor

@ziv1234 ziv1234 commented Apr 24, 2020

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

  • 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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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

ziv1234 added 3 commits April 25, 2020 08:45
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 balloob merged commit 710deb8 into home-assistant:dev May 5, 2020
if dev_cls in DEVICE_CLASSES:
return dev_cls
return DEFAULT_COVER_CLASS
assert dev_cls in DEVICE_CLASSES
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not good to use assert for production purposes. This should be reverted.

@ziv1234
Copy link
Copy Markdown
Contributor Author

ziv1234 commented May 5, 2020

Ok. Will change it. Do I need a new PR or can I push to the same branch?

@MartinHjelmare
Copy link
Copy Markdown
Member

Please create a new PR.

@lock lock Bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants