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

Support multiple keys in ifttt triggers #21454

Merged
merged 2 commits into from Mar 7, 2019

Conversation

Projects
None yet
4 participants
@zeehio
Copy link
Contributor

zeehio commented Feb 26, 2019

Description:

  • With this PR, multiple ifttt keys are allowed to trigger webhook notifications to multiple users.
  • Backwards compatibility is preserved in config files and schemas.
  • No tests were added as I could not find tests for ifttt triggers and I do not know how to write one.

Related issue (if applicable): (no issue created)

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8751

Example entry for configuration.yaml (if applicable):

# Example configuration.yaml entry
ifttt:
  key: 
    YOUR_KEY_NAME1: YOUR_API_KEY1
    YOUR_KEY_NAME2: YOUR_API_KEY2

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.

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 (No new dependencies)
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py. (No new dependencies)
  • New files were added to .coveragerc. (No new files)

If the code does not interact with devices:

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

This comment has been minimized.

Copy link

homeassistant commented Feb 26, 2019

Hi @zeehio,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@wafflebot wafflebot bot added the in progress label Feb 26, 2019

@zeehio zeehio referenced this pull request Feb 26, 2019

Merged

Support multiple keys in ifttt triggers #8751

2 of 2 tasks complete

@homeassistant homeassistant added cla-signed and removed cla-needed labels Feb 26, 2019

@zeehio zeehio force-pushed the zeehio:feat_ifttt_multiple_keys branch from 1afa93c to e219723 Feb 27, 2019

@zeehio

This comment has been minimized.

Copy link
Contributor Author

zeehio commented Feb 27, 2019

Rebased to fix travis issue

@zeehio zeehio force-pushed the zeehio:feat_ifttt_multiple_keys branch from e219723 to baf8104 Feb 27, 2019

@zeehio zeehio force-pushed the zeehio:feat_ifttt_multiple_keys branch from baf8104 to 9820839 Mar 2, 2019

@amelchio
Copy link
Member

amelchio left a comment

Looks good, just a few small comments.

Show resolved Hide resolved homeassistant/components/ifttt/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/ifttt/__init__.py Outdated
Show resolved Hide resolved homeassistant/components/ifttt/__init__.py Outdated
key = config[DOMAIN][CONF_KEY]
conf_keys = config[DOMAIN][CONF_KEY]
if isinstance(conf_keys, str):
conf_keys = {"default": conf_keys}

This comment has been minimized.

@amelchio

amelchio Mar 3, 2019

Member

Maybe naming it "api" would give a less confusing error message when sending fails.

This comment has been minimized.

@amelchio

amelchio Mar 5, 2019

Member

To be clear, I was suggesting renaming the default here, so the error message does not become IFTTT reported error sending event to default which seems a bit gibberish to me.

Just a suggestion though, no biggie :)

Rename `to` to `target` in ifttt.
Follow PR code review suggestions
@zeehio

This comment has been minimized.

Copy link
Contributor Author

zeehio commented Mar 5, 2019

Thanks for the code review! I believe I have addressed all your suggestions and I have updated the documentation PR accordingly. Thanks again!

@balloob balloob merged commit 9f06be7 into home-assistant:dev Mar 7, 2019

4 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on feat_ifttt_multiple_keys at 92.756%
Details

@wafflebot wafflebot bot removed the in progress label Mar 7, 2019

@balloob balloob referenced this pull request Mar 20, 2019

Merged

0.90.0 #22216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.