Skip to content

deCONZ device automations#26366

Merged
balloob merged 29 commits into
home-assistant:devfrom
Kane610:deconz-device-automation
Sep 10, 2019
Merged

deCONZ device automations#26366
balloob merged 29 commits into
home-assistant:devfrom
Kane610:deconz-device-automation

Conversation

@Kane610
Copy link
Copy Markdown
Member

@Kane610 Kane610 commented Sep 2, 2019

Breaking Change:

Description:

Related issue (if applicable): fixes #

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

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 user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 2, 2019

Ping @balloob @emontnemery feedback wanted (half of the file is a copy paste from light device automation) Ive focused on getting something from async_get_triggers

Current output is:
[{'platform': 'device', 'domain': 'deconz', 'type': 1002, 'device_id': '8addb7aeb20c474796bac65d4e6dbfd8', 'event': 'dimmer_switch_2'}, {'platform': 'device', 'domain': 'deconz', 'type': 4002, 'device_id': '8addb7aeb20c474796bac65d4e6dbfd8', 'event': 'dimmer_switch_2'}]
Early work in progress, tomorrow Im gonna start looking at being able to use the triggers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It took me 5 readings before I understood this. Can we put quotes around "turn on"?

Also, let's make the key not just turn_on, but instead be more precise, like remote_turn_on

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually wondering if we can come up with a better sentence.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread homeassistant/components/deconz/deconz_event.py Outdated
Comment thread homeassistant/components/deconz/deconz_event.py Outdated
Comment thread homeassistant/components/deconz/deconz_event.py Outdated
@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 4, 2019

@balloob no comments on the device automation?

Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
@emontnemery
Copy link
Copy Markdown
Contributor

Can you update the example output in the description, it doesn't seem to match the implementation.

Comment thread homeassistant/components/deconz/device_automation.py Outdated
@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 4, 2019

Current output, 16 different triggers, it can probably be improved:

[{'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_on_short_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_on_short_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_on_long_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_on_long_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_up_short_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_up_short_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_up_long_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_up_long_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_down_short_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_down_short_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_down_long_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_dim_down_long_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_off_short_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_off_short_release', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_off_long_press', 'unique_id': '00:11:22:33:44'}, {'device_id': '91f43d7131e842e4ada0f91112974a9e', 'domain': 'deconz', 'platform': 'device', 'type': 'remote_button_turn_off_long_release', 'unique_id': '00:11:22:33:44'}]

Comment thread homeassistant/components/deconz/.translations/en.json Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/device_automation.py Outdated
Comment thread homeassistant/components/deconz/strings.json Outdated
@balloob
Copy link
Copy Markdown
Member

balloob commented Sep 4, 2019

This is looking very solid. Couple of small comments and it's good to go.

@Kane610 Kane610 force-pushed the deconz-device-automation branch from bc648e3 to e3f1cf6 Compare September 6, 2019 21:13
@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 6, 2019

Whats left to do;

  1. redo triggers based on @emontnemery improved work for frontend
  2. tests

@Kane610 Kane610 force-pushed the deconz-device-automation branch 2 times, most recently from 1e71f60 to 1e26581 Compare September 8, 2019 19:53
@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 8, 2019

Screenshot 2019-09-08 at 22 21 52
Feedback wanted :)

@Kane610 Kane610 marked this pull request as ready for review September 8, 2019 21:07
@Kane610
Copy link
Copy Markdown
Member Author

Kane610 commented Sep 8, 2019

Everything is ready, added tests and added subtype

@Kane610 Kane610 force-pushed the deconz-device-automation branch from 1b65d83 to d9f4b87 Compare September 10, 2019 21:23
@balloob balloob merged commit c680c07 into home-assistant:dev Sep 10, 2019
@Kane610 Kane610 deleted the deconz-device-automation branch September 11, 2019 05:06
@lock lock Bot locked and limited conversation to collaborators Sep 12, 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.

5 participants