Skip to content

Conversation

@raman325
Copy link
Contributor

Proposed change

In #32151 I fixed a bug that occurred when the config entry data dictionary did not have volume_step. @MartinHjelmare identified that the change I made was redundant in that I was falling back to the DEFAULT_VOLUME_STEP when checking the config, but that is unnecessary because config validation already guarantees that the volume_step parameter is in the config dictionary, so this change fixes that. As part of looking into this, I also realized that I did not set volume_step in the data dictionary on initialization, which means that the second import (e.g. on a restart) would always set it. I have updated the logic to always ensure it is included in the config entry data.

This should go out with 0.106 along with the other linked PR

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

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

@raman325 raman325 changed the title Vizio bugfix fix Vizio bugfix fix for PR #32151 to avoid KeyError Feb 25, 2020
@MartinHjelmare MartinHjelmare changed the title Vizio bugfix fix for PR #32151 to avoid KeyError Improve Vizio fix to avoid KeyError Feb 25, 2020
@MartinHjelmare MartinHjelmare added this to the 0.106.0 milestone Feb 25, 2020
@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #32163 into dev will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #32163      +/-   ##
==========================================
- Coverage   94.74%   94.73%   -0.01%     
==========================================
  Files         768      768              
  Lines       55629    55619      -10     
==========================================
- Hits        52703    52693      -10     
  Misses       2926     2926
Impacted Files Coverage Δ
homeassistant/components/vizio/media_player.py 100% <100%> (ø) ⬆️
homeassistant/components/vizio/config_flow.py 100% <100%> (ø) ⬆️
homeassistant/components/twitch/sensor.py 96.7% <0%> (-0.04%) ⬇️
homeassistant/components/darksky/sensor.py 96.81% <0%> (ø) ⬆️
homeassistant/components/withings/const.py 100% <0%> (ø) ⬆️
...eassistant/components/homekit_controller/sensor.py 100% <0%> (ø) ⬆️
homeassistant/components/geonetnz_volcano/const.py 100% <0%> (ø) ⬆️
homeassistant/components/awair/sensor.py 95.09% <0%> (ø) ⬆️
homeassistant/components/smartthings/sensor.py 100% <0%> (ø) ⬆️
homeassistant/components/google_assistant/trait.py 97.19% <0%> (ø) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c98f501...7b5f166. Read the comment docs.

Copy link
Member

@MartinHjelmare MartinHjelmare 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!

@balloob balloob merged commit 4236d62 into home-assistant:dev Feb 25, 2020
@raman325 raman325 deleted the vizio_bug_fix branch February 25, 2020 03:51
balloob pushed a commit that referenced this pull request Feb 25, 2020
* dont set default volume_step on import check

* ensure config entry data['volume_step'] is set

* consolidate entry update during entry setup
@lock lock bot locked and limited conversation to collaborators Feb 28, 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