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

Reorg device automation #26880

Merged
merged 5 commits into from Sep 24, 2019

Conversation

@balloob
Copy link
Member

commented Sep 24, 2019

Breaking Change:

Custom component developers that started playing with device automations only: we have restructured how integrations can expose their device triggers/conditions/actions. Instead of 1 platform device_automation.py it's now device_action.py, device_trigger.py, device_condition.py.

The method to attach a device trigger has been updated from async_trigger to async_attach_trigger to better reflect what is going on.

Description:

When I was creating #26871 I realized that device automation files are getting pretty long, pretty fast. I also realized that there is a pretty clean cut possible by separating triggers, conditions and actions. This does so.

I will update #26871 to also have three different scaffolding templates.

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 the code does not interact with devices:

  • Tests have been added to verify that the new code works.
balloob added 2 commits Sep 24, 2019

return automations


async def async_get_actions(hass, device_id, domain):
"""List device actions."""
print("YO")

This comment has been minimized.

Copy link
@emontnemery

emontnemery Sep 24, 2019

Contributor

Stale debug print

@balloob balloob merged commit 6fdff9f into dev Sep 24, 2019
4 of 9 checks passed
4 of 9 checks passed
CI Build #20190924.85 failed
Details
CI (FullCheck Mypy) FullCheck Mypy failed
Details
CI (FullCheck Pylint) FullCheck Pylint failed
Details
CI (Tests PyTest Python36) Tests PyTest Python36 failed
Details
CI (Tests PyTest Python37) Tests PyTest Python37 failed
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
cla-bot Everyone involved has signed the CLA
Dev automation moved this from Needs review to Done Sep 24, 2019
@delete-merged-branch delete-merged-branch bot deleted the reorg-device-automation branch Sep 24, 2019
@lock lock bot locked and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.