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

Allow targeting areas in service calls #21472

Merged
merged 3 commits into from Mar 4, 2019

Conversation

@balloob
Copy link
Member

balloob commented Feb 27, 2019

Description:

This allows selecting entities in a service call by passing in an area_id.

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 the code does not interact with devices:

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

balloob added some commits Feb 26, 2019

@balloob balloob force-pushed the use-area-service-extract branch from 2342110 to 7287895 Mar 2, 2019

"""
if not (service_call.data and ATTR_ENTITY_ID in service_call.data):
return []
return run_coroutine_threadsafe(

This comment has been minimized.

Copy link
@andrewsayre

andrewsayre Mar 3, 2019

Contributor

We're within the event loop/coroutine, doesn't it raise a RuntimeError?

This comment has been minimized.

Copy link
@balloob

balloob Mar 3, 2019

Author Member

That should not have been async. Copy paste error.

This comment has been minimized.

Copy link
@balloob

balloob Mar 3, 2019

Author Member

We might even be able to remove this method completely, but I don't know if any custom component is using it.

Show resolved Hide resolved homeassistant/helpers/service.py Outdated
Show resolved Hide resolved homeassistant/helpers/entity_registry.py Outdated
extracted.update(
entity.entity_id
for device in devices
for entity in

This comment has been minimized.

Copy link
@MartinHjelmare
@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Looks good!

@balloob balloob merged commit 8213016 into dev Mar 4, 2019

5 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
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls First build on use-area-service-extract at 92.757%
Details

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

@delete-merged-branch delete-merged-branch bot deleted the use-area-service-extract branch Mar 4, 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.