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

Rachio component modernization #16911

Merged
merged 1 commit into from Sep 27, 2018

Conversation

@OverloadUT
Contributor

OverloadUT commented Sep 27, 2018

Description:

Some modernization to the Rachio component:

  • Add unique_id to all rachio entities
  • Add platform discovery to rachio component, removing the need to specify rachio switch and binary_sensor platforms manually
  • Move config options from switch.rachio platform to the rachio component

Related issue (if applicable): fixes n/a

Pull request in home-assistant.io with documentation (if applicable): pending

Breaking Change

The Rachio component no longer requires you to specify switch and binary_sensor platforms. These platforms will be initialized automatically by the Rachio component. For the end user, this means:

  1. Remove switch and binary_sensor entries with platform: rachio
  2. If you configured manual_run_mins on the switch platform, move that parameter to the rachio: component configuration.

Example entry for configuration.yaml (if applicable):

rachio:
  api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  manual_run_mins: 10

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][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.
Rachio component modernization
Add `unique_id` to all rachio entities
Add platform discovery to rachio component
Move config options from switch.rachio platform to the rachio component
# Load platforms
for component in SUPPORTED_DOMAINS:
discovery.load_platform(hass, component, DOMAIN, {}, config)

This comment has been minimized.

@pvizeli

pvizeli Sep 27, 2018

Member

You can push the time config with {} to platform without need store it to hass.data the hole runtime.

This comment has been minimized.

@OverloadUT

OverloadUT Sep 27, 2018

Contributor

I was trying to figure out how that works! Thanks for the hint; I'll fix this.

This comment has been minimized.

@balloob

balloob Sep 27, 2018

Member

I think that it's nicer to have it all in 1 location, which is the person. That is also how it is going to be done when you migrate to config entries.

@@ -13,7 +13,7 @@
from homeassistant.auth.util import generate_secret
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import CONF_API_KEY, EVENT_HOMEASSISTANT_STOP, URL_API
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import discovery, config_validation as cv

This comment has been minimized.

@balloob

balloob Sep 27, 2018

Member

Oh man discovery, all the cool kids are already using config entries!

This comment has been minimized.

@OverloadUT

OverloadUT Sep 27, 2018

Contributor

That's the next step! Minimal features per PR!

(really I just needed unique_id here, and fixed this while I had it open)

@balloob balloob merged commit 9abdbf3 into home-assistant:dev Sep 27, 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 Coverage decreased (-0.002%) to 93.6%
Details

@wafflebot wafflebot bot removed the in progress label Sep 27, 2018

@OverloadUT OverloadUT referenced this pull request Sep 30, 2018

Merged

Rachio modernization updates #6380

2 of 2 tasks complete

@balloob balloob referenced this pull request Oct 12, 2018

Merged

0.80.0 #17361

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