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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of Z-Wave config entry vs yaml config #25112

Merged
merged 2 commits into from Jul 27, 2019

Conversation

@cgarwood
Copy link
Contributor

commented Jul 12, 2019

Breaking Change:

If a Z-Wave network_key is specified in configuration.yaml it will override a network_key specified in the Z-Wave config entry.

Description:

Currently usb_path and network_key are stored in the Z-Wave config entry. There was a PR last fall to allow usb_path in configuration.yaml to override the config entry usb_path

This PR merges both sets of configuration into one config dict, with YAML config overriding config entry config if there is a duplicate. The merged config is then stuck in hass.data for future access for the Z-Wave websocket API.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

@cgarwood cgarwood requested a review from home-assistant/z-wave as a code owner Jul 12, 2019

@ghost

This comment has been minimized.

Copy link

commented Jul 12, 2019

Hey there @home-assistant/z-wave, mind taking a look at this pull request as its been labeled with a integration (zwave) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

@cgarwood cgarwood force-pushed the cgarwood:zwave-config-merge branch from 44f448d to 599cc12 Jul 12, 2019

@MartinHjelmare MartinHjelmare added this to Needs review in Dev Jul 23, 2019

if DATA_ZWAVE_CONFIG in hass.data:
config = hass.data[DATA_ZWAVE_CONFIG]
config.update(hass.data[DATA_ZWAVE_CONFIG])

This comment has been minimized.

Copy link
@balloob

balloob Jul 26, 2019

Member

Let's make a copy so that we don't override the data in the config entry accidentally.

config = {**config, **hass.data[DATA_ZWAVE_CONFIG]}

Dev automation moved this from Needs review to Reviewer approved Jul 26, 2019

@balloob
Copy link
Member

left a comment

ok to merge when comment addressed

@MartinHjelmare MartinHjelmare changed the title Improved handling of Z-Wave config entry vs yaml config Improve handling of Z-Wave config entry vs yaml config Jul 26, 2019

@balloob balloob merged commit 0a6d49b into home-assistant:dev Jul 27, 2019

9 checks passed

CI Build #20190727.5 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python35) Tests PyTest Python35 succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA

Dev automation moved this from Reviewer approved to Done Jul 27, 2019

@lock lock bot locked and limited conversation to collaborators Jul 28, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
3 participants
You can’t perform that action at this time.