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 config flow to Meteo-France #29927

Merged
merged 17 commits into from Feb 4, 2020

Conversation

@Quentame
Copy link
Contributor

Quentame commented Dec 13, 2019

Breaking Change:

No more monitored_conditions, all sensors will be added --> ADR-03

Description:

Adding config flow to Météo-France

Pull request with documentation for home-assistant.io : home-assistant/home-assistant.io#11474

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

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Dec 13, 2019

Hey there @victorcerutti, @oncleben31, mind taking a look at this pull request as its been labeled with a integration (meteo_france) you are listed as a codeowner for? Thanks!

@frenck frenck added the docs-missing label Dec 16, 2019
@Quentame Quentame force-pushed the Quentame:meteo_france/config-flow branch from 8d1b15d to 96a78be Dec 16, 2019
@Quentame Quentame mentioned this pull request Dec 16, 2019
2 of 2 tasks complete
@frenck frenck removed the docs-missing label Dec 18, 2019
@Quentame Quentame force-pushed the Quentame:meteo_france/config-flow branch from 96a78be to 28f3f9d Dec 21, 2019
@Quentame Quentame force-pushed the Quentame:meteo_france/config-flow branch 3 times, most recently from e1daff0 to ed718c1 Jan 2, 2020
@Quentame

This comment has been minimized.

Copy link
Contributor Author

Quentame commented Jan 10, 2020

@springstan if you have a little time, I will appreciated a review, and why not an approval 😉

Dev automation moved this from Needs review to Review in progress Jan 11, 2020
Copy link
Member

springstan left a comment

@Quentame I have found some time to look over your code, please see my review comments for more information 😊

homeassistant/components/meteo_france/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/__init__.py Outdated Show resolved Hide resolved
@Quentame

This comment has been minimized.

Copy link
Contributor Author

Quentame commented Jan 11, 2020

Thanks a lot for taking your time on my PR and for your review @springstan

@springstan

This comment has been minimized.

Copy link
Member

springstan commented Jan 11, 2020

Of course @Quentame, no problem at all.

Copy link
Member

springstan left a comment

LGTM 🎉

Dev automation moved this from Review in progress to Reviewer approved Jan 11, 2020
@Quentame Quentame force-pushed the Quentame:meteo_france/config-flow branch from 157a7f1 to e1610df Jan 27, 2020
homeassistant/components/meteo_france/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/meteo_france/sensor.py Outdated Show resolved Hide resolved
Dev automation moved this from Reviewer approved to Review in progress Feb 2, 2020
Quentame added 5 commits Dec 5, 2019
@Quentame Quentame force-pushed the Quentame:meteo_france/config-flow branch from e1610df to bd7ffb4 Feb 3, 2020
Quentame added 2 commits Feb 3, 2020
@Quentame Quentame requested a review from MartinHjelmare Feb 3, 2020
update=False,
) as service_mock:
service_mock.return_value.get_data.return_value = {"name": CITY_2_NAME}
yield service_mock

This comment has been minimized.

Copy link
@Quentame

Quentame Feb 3, 2020

Author Contributor

@MartinHjelmare Is it possible to make conditional tests with MagicMock ?

That would be like :

if service_mock.return_value.postal_code == CITY_1_POSTAL:
    service_mock.return_value.get_data.return_value = {"name": CITY_1_NAME}
else if service_mock.return_value.postal_code == CITY_2_POSTAL:
    service_mock.return_value.get_data.return_value = {"name": CITY_2_NAME}

Looked but can't find.

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Feb 3, 2020

Member

Depends on what the attributes on the mock return. By default they return mocks, so they need to be set or specced by something.

Quentame added 3 commits Feb 3, 2020
@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Feb 3, 2020

Make sure to update the breaking change paragraph.

Ping me when that is done and the tests are ready and I'll have a final look.

@Quentame

This comment has been minimized.

Copy link
Contributor Author

Quentame commented Feb 3, 2020

@MartinHjelmare Documentation updated + breaking change paragraph updated + tests passing 😊

Copy link
Member

MartinHjelmare left a comment

Looks good! Just some small comments.

Quentame added 2 commits Feb 4, 2020
@Quentame

This comment has been minimized.

Copy link
Contributor Author

Quentame commented Feb 4, 2020

Tested with import :

meteo_france:
  - city: Paris
  - city: '75001'
  - city: '75004'
  - city: '75009'
  - city: Lyon
  - city: '69001'
  - city: '69004'
  - city: '69009'
  - city: '74220'

And needed a little more fix.

@Quentame Quentame requested a review from MartinHjelmare Feb 4, 2020
@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 4, 2020

Codecov Report

Merging #29927 into dev will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##              dev   #29927    +/-   ##
========================================
  Coverage   94.62%   94.62%            
========================================
  Files         749      750     +1     
  Lines       54193    54313   +120     
========================================
+ Hits        51278    51393   +115     
- Misses       2915     2920     +5     
Impacted Files Coverage Δ
homeassistant/components/samsungtv/config_flow.py 98.19% <0.00%> (-0.80%) ⬇️
homeassistant/components/alexa/capabilities.py 93.37% <0.00%> (-0.19%) ⬇️
homeassistant/components/template/light.py 97.69% <0.00%> (-0.16%) ⬇️
...meassistant/components/meteo_france/config_flow.py 100.00% <0.00%> (ø)
homeassistant/components/alexa/entities.py 98.50% <0.00%> (+<0.01%) ⬆️
homeassistant/components/samsungtv/media_player.py 96.57% <0.00%> (+0.14%) ⬆️
homeassistant/components/homematicip_cloud/hap.py 84.76% <0.00%> (+0.41%) ⬆️
homeassistant/components/derivative/sensor.py 88.63% <0.00%> (+1.45%) ⬆️

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 45c997e...90c63f9. Read the comment docs.

@Quentame Quentame requested a review from MartinHjelmare Feb 4, 2020
Copy link
Member

MartinHjelmare left a comment

Nice!

Dev automation moved this from Review in progress to Reviewer approved Feb 4, 2020
@MartinHjelmare MartinHjelmare merged commit 201ea25 into home-assistant:dev Feb 4, 2020
10 checks passed
10 checks passed
CI Build #20200204.43 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 94.62%)
Details
codecov/project 94.62% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Feb 4, 2020
@Quentame Quentame deleted the Quentame:meteo_france/config-flow branch Feb 4, 2020
@lock lock bot locked and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.