Skip to content

Add support for HomeKit motion sensor devices#20555

Merged
balloob merged 1 commit intohome-assistant:devfrom
Jc2k:homekit_motion
Jan 29, 2019
Merged

Add support for HomeKit motion sensor devices#20555
balloob merged 1 commit intohome-assistant:devfrom
Jc2k:homekit_motion

Conversation

@Jc2k
Copy link
Copy Markdown
Member

@Jc2k 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
@ghost ghost removed the in progress label Jan 29, 2019
@Jc2k Jc2k deleted the homekit_motion branch January 29, 2019 07:05
@property
def is_on(self):
"""Has motion been detected."""
if not self.available:
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.

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

@Jc2k Jc2k mentioned this pull request Jan 29, 2019
9 tasks
@Jc2k
Copy link
Copy Markdown
Member Author

Jc2k commented Jan 29, 2019

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

@balloob balloob mentioned this pull request Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants