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

Add support for HomeKit motion sensor devices #20555

Merged
merged 1 commit into from Jan 29, 2019

Conversation

Projects
None yet
4 participants
@Jc2k
Copy link
Contributor

Jc2k commented Jan 28, 2019

Description:

Add support for polling HomeKit motion sensors.

I'm testing with an Eve Motion (on my bluetooth branch) and a homekit_python demoserver accessory based on the HAP spec (page 225). A HomeKit motion sensor will have a service of type public.hap.service.sensor.motion with a single required characteristic of public.hap.characteristic.motion-detected which is a bool. The characteristic will be set to true after motion is detected and will return to false after a minute or so with no motion detected. (In the case of the Eve Motion you can tweak this duration in the app).

Related issue (if applicable): fixes #

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

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.

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.

If the code does not interact with devices:

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

@balloob balloob merged commit e22802a into home-assistant:dev Jan 29, 2019

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.004%) to 92.99%
Details

@wafflebot wafflebot bot removed the in progress label Jan 29, 2019

@Jc2k Jc2k deleted the Jc2k:homekit_motion branch Jan 29, 2019

@property
def is_on(self):
"""Has motion been detected."""
if not self.available:

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Jan 29, 2019

Member

This check isn't necessary. It will be handled by the base entity class.

@Jc2k Jc2k referenced this pull request Jan 29, 2019

Merged

HomeKit motion sensor review feedback #20568

3 of 9 tasks complete
@Jc2k

This comment has been minimized.

Copy link
Contributor Author

Jc2k commented Jan 29, 2019

Opened #20568 to make sure this isn't lost.

@balloob balloob referenced this pull request Feb 6, 2019

Merged

0.87.0 #20794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment