Skip to content

Add ability to monitor relay events#18730

Merged
balloob merged 2 commits into
home-assistant:devfrom
oblogic7:doorbird_relay_events
Jan 11, 2019
Merged

Add ability to monitor relay events#18730
balloob merged 2 commits into
home-assistant:devfrom
oblogic7:doorbird_relay_events

Conversation

@oblogic7
Copy link
Copy Markdown
Contributor

@oblogic7 oblogic7 commented Nov 26, 2018

Description:

Enables ability to trigger actions in Home Assistant when Doorbird relay is triggered.

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

Example entry for configuration.yaml (if applicable):

doorbird:
  token: YOUR_DOORBIRD_TOKEN
  devices:
    - host: DOORBIRD_IP_OR_HOSTNAME
      username: YOUR_USERNAME
      password: YOUR_PASSWORD
      name: Driveway Gate
      monitored_conditions:
        - doorbell
        - motion
        - relay

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 (example).
  • 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.
  • New files were added to .coveragerc.

@oblogic7
Copy link
Copy Markdown
Contributor Author

oblogic7 commented Jan 3, 2019

This is ready to go. Any reason it has sat for so long?

@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 11, 2019

We were on a break and had over 190 open PRs, things take time…

@balloob balloob merged commit 199db72 into home-assistant:dev Jan 11, 2019
@ghost ghost removed the in progress label Jan 11, 2019
entry = self.device.get_schedule_entry(event, str(relay))
entry.output.append(output)
resp = self.device.change_schedule(entry)
return resp
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.

Is this return correct? It looks weird in this place. Also, nothing is checking the return value of this method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The return is unnecessary, but shouldn't cause any problems since the calling code does not expect a return value. I have some other housekeeping tasks planned for this component and will clean this up as part of those changes.

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.

Should we really return inside the loop?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope. You're right. Guess I'll go ahead and knock out those changes...

@balloob balloob mentioned this pull request Jan 23, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Feb 12, 2019
* Add ability to monitor relay events

* Account for empty events array instead of none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants