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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new launch sensor to keep track of space launches. #18274

Merged
merged 7 commits into from Nov 8, 2018

Conversation

Projects
None yet
7 participants
@ludeeus
Member

ludeeus commented Nov 6, 2018

Description:

Adda a new sensor to show the next upcoming space launch 馃殌

image

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

Example entry for configuration.yaml (if applicable):

sensor:
  platform: launch

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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

I think that we should throttle the sensor by default. Maybe something like 10 or 15 min. The data is pretty static and there seems to be no need to poll with the default interval.

@ludeeus ludeeus changed the title from Add new launch sensor to keep track of space launches. to WIP: Add new launch sensor to keep track of space launches. Nov 7, 2018

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 7, 2018

I will add that @fabaff and also make the package reuse the aiohttp session from homeassistant as mentioned here: #18237 (comment)

@balloob

This comment has been minimized.

Member

balloob commented Nov 7, 2018

10 or 15 minutes? What about 24 hours? This is very static info鈥

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 7, 2018

Some days have multiple launches, my plan was to set it to 1-hour intervals

@amelchio

This comment has been minimized.

Member

amelchio commented Nov 7, 2018

I guess the launch_time could be used for some custom polling? Maybe not worth it ...

@ludeeus ludeeus changed the title from WIP: Add new launch sensor to keep track of space launches. to Add new launch sensor to keep track of space launches. Nov 7, 2018

@MartinHjelmare

Just some style things.

Show resolved Hide resolved homeassistant/components/sensor/launch.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/launch.py Outdated
Bump pylaunches, remove . from log, fix line breaker for agency_count鈥
鈥y_code, remove CONF_ from ATTRIBUTION.
@amelchio

I think this is ready to fly!

@fabaff fabaff merged commit fd2987e into home-assistant:dev Nov 8, 2018

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 First build on launch at 93.03%
Details

@wafflebot wafflebot bot removed the in progress label Nov 8, 2018

@balloob

This comment has been minimized.

Member

balloob commented Nov 8, 2018

Soo, would people agree that this name is a bit too generic ?

@balloob

This comment has been minimized.

Member

balloob commented Nov 8, 2018

I would think that launch_library would be a better name, as it reflects the name of the service.

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 8, 2018

@balloob I do not disagree with that do you want me to make a PR to change it?

@ludeeus ludeeus deleted the ludeeus:launch branch Nov 8, 2018

@balloob

This comment has been minimized.

Member

balloob commented Nov 9, 2018

Yes let's do it to before it is released

@ludeeus

This comment has been minimized.

Member

ludeeus commented Nov 9, 2018

I'll start that now :)

@ludeeus ludeeus referenced this pull request Nov 9, 2018

Merged

Rename sensor.launch to sensor.launch_library #18337

8 of 8 tasks complete

zxdavb added a commit to zxdavb/home-assistant that referenced this pull request Nov 13, 2018

Add new launch sensor to keep track of space launches. (home-assistan鈥
鈥#18274)

* Add new launch sensor to keep track of space launches.

* Added attribution to Launch Library.

* Adds data class and throtle, reuse aiohttp session.

* Add one extra blank line before the new class..

* Change throttle to simpler SCAN_INTERVAL.

* Remove the usage of the LaunchData class.

* Bump pylaunches, remove . from log, fix line breaker for agency_country_code, remove CONF_ from ATTRIBUTION.

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment