Skip to content

Reorg device automation#26880

Merged
balloob merged 5 commits into
devfrom
reorg-device-automation
Sep 24, 2019
Merged

Reorg device automation#26880
balloob merged 5 commits into
devfrom
reorg-device-automation

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob 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.


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

Choose a reason for hiding this comment

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

Stale debug print

Comment thread tests/components/deconz/test_device_trigger.py
@balloob balloob merged commit 6fdff9f into dev Sep 24, 2019
@delete-merged-branch delete-merged-branch Bot deleted the reorg-device-automation branch September 24, 2019 21:57
@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants