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 support for World Wide Lightning Location Network #25001

Merged
merged 15 commits into from Jul 10, 2019

Conversation

@bachya
Copy link
Contributor

commented Jul 7, 2019

Description:

This PR adds support for the World Wide Lightning Location Network (WWLLN) as a geolocation platform.

Related issue (if applicable): N/A

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

Example entry for configuration.yaml (if applicable):

wwlln:

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.

@bachya bachya self-assigned this Jul 7, 2019

@bachya bachya referenced this pull request Jul 7, 2019
2 of 2 tasks complete
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Jul 7, 2019

Sounds like this could better be a geo_location platform?

For each lightning strike within the configured radius a new geo_location entity is created. Optionally let the time frame be configured to set the clean up window when entities should be removed.

If the user wants to count strikes a template sensor can be used.

@bachya

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2019

@MartinHjelmare Interesting! Let me ponder that. One issue I currently see: the geo_rss_events component seems to expect everything in metric, but I want to give users the ability to use whatever unit system they've defined in their configuration.yaml. I suppose I could convert imperial units to metric units (when necessary) before instantiating a GeoRSS client..

EDIT: Another issue is that the geo_rss_events component expects an HTTP-hosted XML stream as input data; that won't exist in this case. Rather, I would need to give aiowwlln a method that can produce valid GeoRSS XML and then modify python-georss-generic-client to accept that raw input. Seems like a lot of work, no?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Jul 7, 2019

The geo_location component is a general base component and doesn't rely on any specific library or metric system.

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/geo_location/__init__.py

@bachya

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2019

Ahh, okay; I misread and assumed you meant GeoRSS. Let me dig into this a bit.

@bachya bachya force-pushed the bachya:wwlln branch from 947d307 to b588fc0 Jul 9, 2019

@bachya

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

@MartinHjelmare I've refocused this PR from sensors to geolocation; will appreciate your thoughts at your leisure.

FYI, this is now waiting on #25046 (which allows geolocation platforms to use config entries).

@MartinHjelmare
Copy link
Member

left a comment

Looks good!

homeassistant/components/wwlln/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/wwlln/geo_location.py Outdated Show resolved Hide resolved
@bachya

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

@MartinHjelmare In addition to addressing your latest feedback, I realized aiowwlln wasn't providing a good "window" option, meaning strike data could feasibly hang on for way too long. The latest commits add this; sorry for additional chunks to review.

@bachya bachya force-pushed the bachya:wwlln branch from 771d74e to 9b52957 Jul 10, 2019

@MartinHjelmare
Copy link
Member

left a comment

Looks great!

Unfortunately python 3.7 tests are flaky at the moment so I can't merge. We have to wait for an admin or until we fix the tests and can rebase.

bachya added some commits Jul 7, 2019

bachya added some commits Jul 9, 2019

@bachya bachya force-pushed the bachya:wwlln branch from ea2c3b9 to 00b314b Jul 10, 2019

@bachya bachya merged commit 9ccb85d into home-assistant:dev Jul 10, 2019

13 checks passed

build Workflow: build
Details
ci/circleci: pre-install-all-requirements Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.5.5 Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.6 Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.7 Your tests passed on CircleCI!
Details
ci/circleci: pylint Your tests passed on CircleCI!
Details
ci/circleci: static-check Your tests passed on CircleCI!
Details
ci/circleci: test 3.5.5 Your tests passed on CircleCI!
Details
ci/circleci: test 3.6 Your tests passed on CircleCI!
Details
ci/circleci: test 3.7 Your tests passed on CircleCI!
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 97.14% of diff hit (target 94.07%)
Details
codecov/project 94.07% (target 90%)
Details

@bachya bachya deleted the bachya:wwlln branch Jul 10, 2019

@lock lock bot locked and limited conversation to collaborators Jul 11, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.