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

Rachio component modernization #16911

Merged
merged 1 commit into from
Sep 27, 2018

Conversation

OverloadUT
Copy link
Contributor

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.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@ghost ghost removed the in progress label Sep 27, 2018
@balloob balloob mentioned this pull request Oct 12, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
@OverloadUT OverloadUT deleted the rachio-improvements branch May 2, 2019 20:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants