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

Add ability to configure OpenUV "protection window" UV indices #54562

Merged
merged 4 commits into from Aug 24, 2021

Conversation

bachya
Copy link
Contributor

@bachya bachya commented Aug 12, 2021

Proposed change

This PR adds the ability to configure UV window options (i.e., the "starting" and "ending" UV indices during which sunblock protection is recommended).

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

Additional information

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

To help with the load of incoming pull requests:

@bachya bachya self-assigned this Aug 12, 2021
@project-bot project-bot bot added this to Needs review in Dev Aug 12, 2021
@project-bot project-bot bot moved this from Needs review to By Code Owner in Dev Aug 12, 2021
@bachya bachya changed the title Add ability to configure UV window options in OpenUV Add ability to configure OpenUV "protection window" UV indices Aug 12, 2021
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Aug 16, 2021
@bdraco
Copy link
Member

bdraco commented Aug 24, 2021

Does the config entry need to be reloaded when you change these values?

@bachya
Copy link
Contributor Author

bachya commented Aug 24, 2021

@bdraco I don't believe so. The underlying API call pulls whatever is in config_entry.options, which is (I believe) always kept up to date.

Dev automation moved this from By Code Owner to Reviewer approved Aug 24, 2021
@bdraco
Copy link
Member

bdraco commented Aug 24, 2021

CI failure is unrelated and being worked on in #55169

@bdraco
Copy link
Member

bdraco commented Aug 24, 2021

(venv) root@ha-dev:~/home-assistant# pytest --cov=homeassistant/components/openuv/ --cov-report term-missing -- tests/components/openuv/test_config_flow.py 
Test session starts (platform: linux, Python 3.8.11, pytest 5.4.3, pytest-sugar 0.9.3)
rootdir: /root/home-assistant
plugins: requests-mock-1.8.0, aiohttp-0.3.0, test-groups-1.0.3, sugar-0.9.4, forked-1.3.0, xdist-2.1.0, timeout-1.4.2, aresponses-2.0.0, socket-0.3.5, mock-3.3.1, cov-2.10.1, rerunfailures-10.1
collecting ... 
 tests/components/openuv/test_config_flow.py ✓✓✓✓                                                                                                              100% ██████████

---------- coverage: platform linux, python 3.8.11-final-0 -----------
Name                                             Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------
homeassistant/components/openuv/config_flow.py      45      1    98%   78
homeassistant/components/openuv/const.py            22      0   100%
------------------------------------------------------------------------------
TOTAL                                               67      1    99%


Results (0.70s):
       4 passed

Looks like line 78 is missing coverage

@bdraco
Copy link
Member

bdraco commented Aug 24, 2021

That's existing (was previously line 64)

Manually verified 100% diff hit

@bdraco bdraco merged commit 24d017f into home-assistant:dev Aug 24, 2021
Dev automation moved this from Reviewer approved to Done Aug 24, 2021
@bachya
Copy link
Contributor Author

bachya commented Aug 24, 2021

Thanks for that, @bdraco – I'll follow up separately.

@bachya bachya deleted the protection-window-options branch August 24, 2021 20:57
@bachya bachya mentioned this pull request Aug 24, 2021
22 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
by-code-owner cla-signed integration: openuv new-feature smash Indicator this PR is close to finish for merging or closing
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants