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

Move elevation to core config and clean up HTTP mocking in tests #2378

Merged
merged 9 commits into from
Jun 27, 2016

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 27, 2016

Description:
We've had a method to fetch the elevation from Google for a while now. This method was used by both the YR platform and Sun component to fetch the elevation of the location. This meant a request to Google APIs on startup unless a user passed in elevation to the configs of either platform or component.

This PR makes elevation a first class citizen of the config object in core and allow it to be set by configuring it in the [homeassistant] section of your config.

Elevation will now be only automatically fetched when we detect core configuration missing it.

I also moved some of the config related code from bootstrap to config, where it belongs.

While writing tests for util.location, I went to use httpretty as recently introduced to test forecast.io. However after reading up on it I noticed that it does not officially support Python 3. As a move to consolidate our HTTP testing efforts, I decided to use requests-mock and migrate the tests that depend on either httpretty or betamax to requests-mock.

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@balloob balloob changed the title Move elevation to core config Move elevation to core config and clean up HTTP mocking in tests Jun 27, 2016
@balloob balloob merged commit 6714392 into dev Jun 27, 2016
@balloob balloob deleted the elevation-fix branch June 27, 2016 16:02
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant