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

Météo-France platform for the weather component #18404

Merged
merged 19 commits into from Feb 14, 2019

Conversation

Projects
None yet
7 participants
@victorcerutti
Copy link
Contributor

victorcerutti commented Nov 12, 2018

This is reopening of #18322 after I removed the weather model change I made.
Discussions about enhancing the weather component (model and frontend) have been posted to :

Description:

After the recently merged Météo-France sensor providing weather datas from Météo-France, here is the weather component
The configuration is similar to the weather sensor and the weather platform also provides a 4 days forecast.

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7480

Example entry for configuration.yaml (if applicable):

weather:
  - platform: meteo_france
    city: '76000'

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.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.
@fabaff
Copy link
Member

fabaff left a comment

At first glance looks the rest pretty solid.

Show resolved Hide resolved homeassistant/components/weather/meteo_france.py Outdated
@victorcerutti

This comment has been minimized.

Copy link
Contributor Author

victorcerutti commented Nov 14, 2018

Please consider my last commit as a work in progress.
I wanted to check if I'm doing this correctly
This is a breaking change for the sensor as the configuration is now done this way:

meteo_france:
  - postal_code: 29000
    monitored_conditions:
        - rain_chance
        - freeze_chance
        - thunder_chance
        - snow_chance
        - weather
        - next_rain
        - wind_speed
        - temperature
        - uv
    weather_card: false
  - postal_code: 76000
    monitored_conditions:
      - temperature
  - postal_code: 51100

For each component, we display by default a weather card (unless config says otherwise) and a sensor for each monitored conditions (optional)

All the logic of client and update is managed by the meteo_france component.
Sensors and weather card only refers to a single client data fetcher for each city.

If this is correct, I will continue in this direction and update the documentation to reflect this changes

@victorcerutti

This comment has been minimized.

Copy link
Contributor Author

victorcerutti commented Nov 26, 2018

@fabaff Can you please review the way the config is set for this component ?
If this is ok I will continue and update the documentation and the PR to introduce this new component.

@victorcerutti victorcerutti force-pushed the victorcerutti:weather_meteo-france branch from b994ce1 to f46ddaa Jan 10, 2019

@victorcerutti

This comment has been minimized.

Copy link
Contributor Author

victorcerutti commented Jan 10, 2019

Hello,
I'd love to have feedback on this PR regarding the configuration here #18404 (comment)

Many thanks for considering my request !

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Feb 6, 2019

We should not have a weather card config option, it's up to the user with Lovelace to decide if they want to show a weather card for an entity or not.

The config seems fine.

@victorcerutti

This comment has been minimized.

Copy link
Contributor Author

victorcerutti commented Feb 7, 2019

Thank you for the feedback
It makes total sense as Lovelace is now default to discard the weather_card option
I will correct this and update this PR soon

victorcerutti added some commits Nov 8, 2018

Update conf name
Changing conf name to something more universal for worldwide weather forecast (postal code was only relevent for France)

@victorcerutti victorcerutti force-pushed the victorcerutti:weather_meteo-france branch from f46ddaa to 9f741c5 Feb 7, 2019

victorcerutti added some commits Feb 7, 2019

@victorcerutti

This comment has been minimized.

Copy link
Contributor Author

victorcerutti commented Feb 7, 2019

I think this is all good
I also updated the documentation according to the new configuration of the component

Show resolved Hide resolved homeassistant/components/meteo_france.py Outdated
Show resolved Hide resolved homeassistant/components/meteo_france.py Outdated
Show resolved Hide resolved homeassistant/components/meteo_france.py
Show resolved Hide resolved homeassistant/components/meteo_france.py Outdated
Show resolved Hide resolved homeassistant/components/weather/meteo_france.py Outdated

victorcerutti added some commits Feb 8, 2019

@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Looks great!

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Feb 8, 2019

Can be merged when build passes.

@fabaff fabaff dismissed their stale review Feb 14, 2019

Comments addressed

@fabaff fabaff merged commit f4b2573 into home-assistant:dev Feb 14, 2019

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 93.355%
Details

@wafflebot wafflebot bot removed the in progress label Feb 14, 2019

@fabaff fabaff referenced this pull request Feb 14, 2019

Merged

Meteo france #21065

7 of 7 tasks complete

mxworm added a commit to mxworm/home-assistant that referenced this pull request Feb 15, 2019

Merge branch 'dev' into current
* dev: (213 commits)
  Bump pyHik library to 0.2.2, improve connections, add sensors (home-assistant#21086)
  Check against unlinked user (home-assistant#21081)
  Rename CONF_ATTRIBUTION to ATTRIBUTION (home-assistant#21069)
  Fix pushover schema
  Climate const.py move (home-assistant#20945)
  Update file header
  Update file header (home-assistant#21061)
  Météo-France platform for the weather component (home-assistant#18404)
  Bumped version to 0.89.0.dev0
  Don't directly update config entries (home-assistant#20877)
  Update file header (home-assistant#21054)
  Upgrade ruamel.yaml to 0.15.88 (home-assistant#21055)
  fix webhook update (home-assistant#21048)
  Add integration method to sensor.integration (home-assistant#21050)
  Person: Ignore unavailable states (home-assistant#21058)
  Person checks (home-assistant#21056)
  Create a person during onboarding (home-assistant#21057)
  Add template support to Bayesian sensor (home-assistant#20757)
  Add Lock capability to SmartThings platform (home-assistant#20977)
  Update translations
  ...

# Conflicts:
#	homeassistant/components/homematicip_cloud/climate.py
@anthosz

This comment has been minimized.

Copy link

anthosz commented Feb 21, 2019

Dear @fabaff @mxworm ,

Do you know in which version this component will be available?

Best regards,

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Feb 21, 2019

0.89

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Feb 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.